<!DOCTYPE html><html><head>
      <title>user_api</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
      
      
      
      
      
      <style>
      code[class*=language-],pre[class*=language-]{color:#333;background:0 0;font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.4;-moz-tab-size:8;-o-tab-size:8;tab-size:8;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.8em;overflow:auto;border-radius:3px;background:#f5f5f5}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal;background:#f5f5f5}.token.blockquote,.token.comment{color:#969896}.token.cdata{color:#183691}.token.doctype,.token.macro.property,.token.punctuation,.token.variable{color:#333}.token.builtin,.token.important,.token.keyword,.token.operator,.token.rule{color:#a71d5d}.token.attr-value,.token.regex,.token.string,.token.url{color:#183691}.token.atrule,.token.boolean,.token.code,.token.command,.token.constant,.token.entity,.token.number,.token.property,.token.symbol{color:#0086b3}.token.prolog,.token.selector,.token.tag{color:#63a35c}.token.attr-name,.token.class,.token.class-name,.token.function,.token.id,.token.namespace,.token.pseudo-class,.token.pseudo-element,.token.url-reference .token.variable{color:#795da3}.token.entity{cursor:help}.token.title,.token.title .token.punctuation{font-weight:700;color:#1d3e81}.token.list{color:#ed6a43}.token.inserted{background-color:#eaffea;color:#55a532}.token.deleted{background-color:#ffecec;color:#bd2c00}.token.bold{font-weight:700}.token.italic{font-style:italic}.language-json .token.property{color:#183691}.language-markup .token.tag .token.punctuation{color:#333}.language-css .token.function,code.language-css{color:#0086b3}.language-yaml .token.atrule{color:#63a35c}code.language-yaml{color:#183691}.language-ruby .token.function{color:#333}.language-markdown .token.url{color:#795da3}.language-makefile .token.symbol{color:#795da3}.language-makefile .token.variable{color:#183691}.language-makefile .token.builtin{color:#0086b3}.language-bash .token.keyword{color:#0086b3}pre[data-line]{position:relative;padding:1em 0 1em 3em}pre[data-line] .line-highlight-wrapper{position:absolute;top:0;left:0;background-color:transparent;display:block;width:100%}pre[data-line] .line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}pre[data-line] .line-highlight:before,pre[data-line] .line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}pre[data-line] .line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}html body{font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ol,html body>ul{margin-bottom:16px}html body ol,html body ul{padding-left:2em}html body ol.no-list,html body ul.no-list{padding:0;list-style-type:none}html body ol ol,html body ol ul,html body ul ol,html body ul ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:700;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::after,html body code::before{letter-spacing:-.2em;content:'\00a0'}html body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:0 0;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:after,html body pre code:before,html body pre tt:after,html body pre tt:before{content:normal}html body blockquote,html body dl,html body ol,html body p,html body pre,html body ul{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body code,html body pre{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview ul{list-style:disc}.markdown-preview ul ul{list-style:circle}.markdown-preview ul ul ul{list-style:square}.markdown-preview ol{list-style:decimal}.markdown-preview ol ol,.markdown-preview ul ol{list-style-type:lower-roman}.markdown-preview ol ol ol,.markdown-preview ol ul ol,.markdown-preview ul ol ol,.markdown-preview ul ul ol{list-style-type:lower-alpha}.markdown-preview .newpage,.markdown-preview .pagebreak{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center!important}.markdown-preview:not([data-for=preview]) .code-chunk .code-chunk-btn-group{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .status{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .output-div{margin-bottom:16px}.markdown-preview .md-toc{padding:0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link div,.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.markdown-preview .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0;min-height:100vh}@media screen and (min-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{font-size:14px!important;padding:1em}}@media print{html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc{padding:0 16px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link div,html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 300px / 2);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

      </style>
      <!-- The content below will be included at the end of the <head> element. --><script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
    // your code here
  });
</script></head><body for="html-export">
    
    
      <div class="crossnote markdown-preview  ">
      
<h1 id="agilex-导航模块api">Agilex 导航模块API </h1>
<h2 id="关于文档">关于文档 </h2>
<h3 id="使用说明">使用说明 </h3>
<ul>
<li>感谢您使用松灵机器人的所有产品，本API文档主要用于松灵机器人导航模块，提供二次开发所需API接口，将根据通信协议类型分为两个API模块:http、websocket。</li>
<li>每条API接口会配备接口说明，协议类型、请求数据、应答数据,参数列表。</li>
<li>地址+端口
<ul>
<li>websocket: ws://机器人IP地址:9090</li>
<li>http: http://机器人IP地址:8880或<a href="http://xn--IP-sb3cl61ax2a0cw67k/urlApi">http://机器人IP地址/urlApi</a></li>
</ul>
</li>
</ul>
<h3 id="发布说明">发布说明 </h3>
<ul>
<li>
<table>
<thead>
<tr>
<th style="text-align:left">版本号</th>
<th style="text-align:left">日期</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">V0.2.3</td>
<td style="text-align:left">2024.5.28</td>
<td style="text-align:left">更新移动控制接口</td>
</tr>
<tr>
<td style="text-align:left">V0.2.2</td>
<td style="text-align:left">2024.4.24</td>
<td style="text-align:left">增加心跳指令注意事项，更新python demo</td>
</tr>
<tr>
<td style="text-align:left">V0.2.1</td>
<td style="text-align:left">2024.2.28</td>
<td style="text-align:left">增加定时任务相关接口,设备相关接口</td>
</tr>
<tr>
<td style="text-align:left">V0.2.0</td>
<td style="text-align:left">2024.1.19</td>
<td style="text-align:left">更新灯光控制接口参数</td>
</tr>
<tr>
<td style="text-align:left">V0.1.9</td>
<td style="text-align:left">2023.12.7</td>
<td style="text-align:left">更新导航系统状态接口参数值</td>
</tr>
<tr>
<td style="text-align:left">V0.1.8</td>
<td style="text-align:left">2023.11.21</td>
<td style="text-align:left">去掉机器人位置接口中的odom_raw 说明, 增加设置导航参数接口</td>
</tr>
<tr>
<td style="text-align:left">V0.1.7</td>
<td style="text-align:left">2023.11.09</td>
<td style="text-align:left">增加postman 使用接口的说明，增加unsubscribe 取消订阅的说明</td>
</tr>
<tr>
<td style="text-align:left">V0.1.6</td>
<td style="text-align:left">2023.10.18</td>
<td style="text-align:left">增加控制柜门控制接口</td>
</tr>
<tr>
<td style="text-align:left">V0.1.5</td>
<td style="text-align:left">2023.10.10</td>
<td style="text-align:left">增加充电信息接口，增加获取机器人在地图上位置流程图</td>
</tr>
<tr>
<td style="text-align:left">V0.1.4</td>
<td style="text-align:left">2023.09.15</td>
<td style="text-align:left">增加subscribe 接口 应答数据的应答频率</td>
</tr>
<tr>
<td style="text-align:left">V0.1.3</td>
<td style="text-align:left">2023.08.25</td>
<td style="text-align:left">增加ws 指令使用注意事项，增加机器人控制状态说明</td>
</tr>
<tr>
<td style="text-align:left">V0.1.2</td>
<td style="text-align:left">2023.07.04</td>
<td style="text-align:left">增加机器人位置注意说明，实时任务角度值说明</td>
</tr>
<tr>
<td style="text-align:left">V0.1.1</td>
<td style="text-align:left">2023.06.25</td>
<td style="text-align:left">增加驻车使能接口说明</td>
</tr>
<tr>
<td style="text-align:left">V0.0.12</td>
<td style="text-align:left">2023.06.06</td>
<td style="text-align:left">增加RTK-GPS接口说明，更新自主充电相关接口</td>
</tr>
<tr>
<td style="text-align:left">V0.0.11</td>
<td style="text-align:left">2023.05.26</td>
<td style="text-align:left">增加地图坐标转换的接口，增加流程图,odom 说明，去掉scout_states</td>
</tr>
<tr>
<td style="text-align:left">V0.0.10</td>
<td style="text-align:left">2023.05.16</td>
<td style="text-align:left">增加地图坐标转换的注意事项</td>
</tr>
<tr>
<td style="text-align:left">V0.0.9</td>
<td style="text-align:left">2023.05.11</td>
<td style="text-align:left">增加建图导航的http接口，列表任务接口参数缺失loopTime</td>
</tr>
<tr>
<td style="text-align:left">V0.0.8</td>
<td style="text-align:left">2023.04.27</td>
<td style="text-align:left">去掉上传图片接口</td>
</tr>
<tr>
<td style="text-align:left">V0.0.7</td>
<td style="text-align:left">2023.04.26</td>
<td style="text-align:left">更新使用指南中的c++ 案例 仓库地址</td>
</tr>
<tr>
<td style="text-align:left">V0.0.6</td>
<td style="text-align:left">2023.04.21</td>
<td style="text-align:left">核对api接口，python 使用案例增加 2d 点云接口</td>
</tr>
<tr>
<td style="text-align:left">V0.0.5</td>
<td style="text-align:left">2023.04.27</td>
<td style="text-align:left">核对api接口，新增参数表格</td>
</tr>
<tr>
<td style="text-align:left">V0.0.4</td>
<td style="text-align:left">2023.04.11</td>
<td style="text-align:left">增加部分名词解释，常用接口添加案例与数</td>
</tr>
<tr>
<td style="text-align:left">V0.0.3</td>
<td style="text-align:left">2023.04.07</td>
<td style="text-align:left">增加点云激光雷达数据,和相机点云接口</td>
</tr>
<tr>
<td style="text-align:left">V0.0.2</td>
<td style="text-align:left">2023.01.31</td>
<td style="text-align:left">增加接口使用流程案例</td>
</tr>
<tr>
<td style="text-align:left">V0.0.1</td>
<td style="text-align:left">2023.01.09</td>
<td style="text-align:left">测试版本</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="注意事项">注意事项 </h3>
<ul>
<li>
<p>http 请求</p>
<ul>
<li>主要用于获取地图、任务、版本等数据。</li>
<li>有GET、POST、DELETE三种请求方式，每个接口都会进行标注。</li>
<li>除登录接口/login外。http 请求接口都需要携带请求头部参数Authorization，作为安全校验。</li>
<li><code>POST</code>中的请求表头Content-Type:application/json 无特殊说明，基本都是application/json</li>
<li>调用登录接口/login,登录成功之后返回的数据，这个数据在<strong>24小时</strong>后失效。作为每个接口所需请求头部参数Authorization的具体值。</li>
</ul>
</li>
<li>
<p>标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>websocket请求</p>
<ul>
<li>主要用于获取经常更新的数据，如底盘数据，激光雷达数据等。</li>
<li>'ping', 'subscribe','unsubscribe', 'call_service'四种请求方式，每个接口都会进行标注。</li>
<li><strong>ping</strong>请求是心跳检测接口，保持连接时需要一直发送数据，超过<em>3</em>秒没有发送该数据，则视为连接断开</li>
<li>如果是前端开发，使用到 ROS js标准库roslib.js,需要携带接口对应的数据类型,如下例子中的"type"字段，如果未使用到roslib.js，可以<strong>不用</strong>携带"type"字段</li>
</ul>
</li>
<li>
<p>名词解释</p>
<ul>
<li>四元数:表示(x,y,z)某一轴的角度值,本文档主要描述的是z轴的角度值转成以下的数据形式:</li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"orientation"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"w"</span><span class="token operator">:</span> <span class="token number">1</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><p><a id="jump_4" href=""> </a></p>
<ul>
<li>时间戳:用于表示数据的发送时间。数据包含时间以及发送目标的<code>frame_id</code>，其中<code>stamp</code>是时间数据,作为输入参数时，可填0,<code>frame_id</code>是坐标系，数据形式如下，</li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code> <span class="token punctuation">{</span>
     <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
         <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
         <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
             <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
             <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token string">""</span>
         <span class="token punctuation">}</span><span class="token punctuation">,</span>
         <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"map"</span>
     <span class="token punctuation">}</span>
 <span class="token punctuation">}</span>
</code></pre></li>
</ul>
<h2 id="http-api">HTTP API </h2>
<h3 id="登录接口">登录接口 </h3>
<h4 id="登录请求">登录请求 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/user/passport/login">http://localhost/apiUrl/user/passport/login</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
无</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
连接机器人端本地服务器，获取token，用于其他接口的请求参数Authorization</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"username"</span><span class="token operator">:</span> <span class="token string">"admin"</span><span class="token punctuation">,</span>
    <span class="token property">"password"</span><span class="token operator">:</span> <span class="token string">"MzYwOGI2YjMyNGI3ODViMTg0ZTk4YmRhNzBlYTBmOTI="</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">username</td>
<td style="text-align:left">string</td>
<td style="text-align:left">用户名</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">password</td>
<td style="text-align:left">string</td>
<td style="text-align:left">密码</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">"MTY3NjA5ODIwOC4yMzY0MDQyJDdmOGEzOTIzNTJmZTAxYzFkOGQ4ZDc1ZTdmMTYzMjBkN2FjNGE0NjM="</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">账号登录成功权限值，有效期为1天(24小时)</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="地图相关接口">地图相关接口 </h3>
<h4 id="建图导航注意事项">建图导航注意事项 </h4>
<ul>
<li>建图与导航使用同一套接口,各有两种形式启动，根据参数对象中的"id_type"字段启动</li>
<li>/slam_operate, post请求</li>
<li>建图两种形式
<ul>
<li>1.首先需要录制bag，然后使用bag构建3d地图，最后使用生成的3d地图构建2d地图</li>
<li>2.录制bag与构建3d地图同时进行,最后生成的3d地图构建2d地图</li>
</ul>
</li>
<li>导航两种形式
<ul>
<li>1.启动标准导航，只能通过给定导航点进行导航</li>
<li>2.启动循线导航，保留导航点导航，同时加入自定义路径导航,按照路径进行导航</li>
</ul>
</li>
<li>导航点坐标转换 <a id="jump_11" href=""></a>
<ul>
<li>二次开发时需要自行编写坐标转换功能的代码</li>
<li>需要用到地图信息数据,详情请参考接口《获取某个地图信息》</li>
</ul>
<pre data-role="codeBlock" data-info="" class="language-text"><code>    {
        "gridHeight": 0,
        "gridWidth": 0,
        "originX": 0,
        "originY": 0,
        "resolution": 0,
    }
</code></pre><ul>
<li>导航点从图片像素坐标(png_x,png_y)转成map坐标(pose_x, pose_y),转换公式如下
<ul>
<li>pose_x = png_x * resolution + originX</li>
<li>pose_x = (gridHeight - png_y) * resolution + originY</li>
<li><strong><a href="#jump_12">转换接口</a></strong></li>
</ul>
</li>
<li>map坐标点(pose_x, pose_y)转成图片像素坐标(png_x,png_y),转换公式如下
<ul>
<li>png_x = (pose_x - originX) / resolution</li>
<li>png_y = gridHeight - (pose_y - originY) / resolution</li>
<li><strong><a href="#jump_13">转换接口</a></strong></li>
</ul>
</li>
</ul>
</li>
</ul>
<p><a id="jump_10" href=""></a></p>
<h4 id="录包建图导航">录包建图导航 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/slam_operate">http://localhost/apiUrl/slam_operate</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
本接口可用于启动录包、建图、导航等程序，包括开启，停止，取消等操作。同时存在websocket版本，但存在参数部分差异，请参考 <strong><a href="#jump_6">建图导航功能</a></strong></p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"opType"</span><span class="token operator">:</span> <span class="token string">"start"</span><span class="token punctuation">,</span>
    <span class="token property">"idType"</span><span class="token operator">:</span> <span class="token string">"record_data"</span><span class="token punctuation">,</span>
    <span class="token property">"fileName"</span><span class="token operator">:</span> <span class="token string">"0508-1"</span><span class="token punctuation">,</span>
    <span class="token property">"mapOperate"</span><span class="token operator">:</span> <span class="token boolean">false</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必填</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">mapOperate</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否同时进行3D&amp;2D建图，只有idType="map_3d"时有效</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">file_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">文件名可用于保存录包名称，构建地图，启动导航地图，三者需保持一致，进行取消操作时，file_name可以为空。</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">opType</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型,可能值<div><div>start: 开启</div><div>stop: 结束某个idType操作，并保存 </div><div>cancel: 取消某个idType操作，不会保存</div><div>pause: 暂停</div><div>continue: 继续</div><div><br></div></div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">idType</td>
<td style="text-align:left">string</td>
<td style="text-align:left">指令类型，可能值<div><div>record_data: 启动录包，保持file</div><div>map_3d: 启动3D建图</div><div>map_2d: 启动2D建图</div><div>navigation：启动标准导航，只能通过给定导航点进行导航</div><div>follow_line: 启动循线导航，可以通过给导航点，也可以给定路径，按照路径进行导航</div><div>set_pcd: 开启导航后，若觉得开启的地图不正确，可以通过该字段切换3D地图，配合set_map使用</div><div>set_map: 开启导航后，若觉得开启的地图不正确，可以通过该字段切换2D地图，配合set_pcd使用</div><div>change_map: 开启导航后，若觉得开启的地图不正确，可以通过该字段同时切换2D地图，3D地图</div><div>record_and_map:启动录包并同时启动3D雷达建图</div><div>way_creator: 启动路径绘制功能</div><div>record_point:启动路径点录制功能，</div><div>record_path:启动路径录制功能，</div><div>close_all:关闭所有在运行的建图和导航节点</div></div></td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
<ul>
<li><strong>应答数据:</strong></li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">"start record_data success."</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<p><a id="jump_1" href=""> </a></p>
<h4 id="获取地图列表">获取地图列表 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/map_list?page=1&amp;limit=5&amp;sortType=&amp;reverse=">http://localhost/apiUrl/map_list?page=1&amp;limit=5&amp;sortType=&amp;reverse=</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取地图列表，返回根据请求参数查询到的地图列表数据</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">page</td>
<td style="text-align:left">int</td>
<td style="text-align:left">页数</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">limit</td>
<td style="text-align:left">int</td>
<td style="text-align:left">一页显示的条目数量，(数值为-1时，获取全部列表数据)</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">sortType</td>
<td style="text-align:left">string</td>
<td style="text-align:left">排序的类型,可填入的值<code>name</code>:按照名称排序, <code>time</code>:按照时间排序, <code>null</code>或者填空:不排序,</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">reverse</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否倒序,可填入的值 <code>true</code>:倒序,<code>false</code>:正序，填空:不排序</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"total"</span><span class="token operator">:</span> <span class="token number">15</span><span class="token punctuation">,</span>
        <span class="token property">"mapList"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"mapTime"</span><span class="token operator">:</span> <span class="token string">"2022-12-15 15:00:53"</span><span class="token punctuation">,</span> 
                <span class="token property">"tasks"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                    <span class="token string">"sad"</span>
                <span class="token punctuation">]</span><span class="token punctuation">,</span> 
                <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">"1215="</span><span class="token punctuation">,</span> 
                <span class="token property">"id"</span><span class="token operator">:</span> <span class="token number">1671087653</span> 
            <span class="token punctuation">}</span>  
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">total</td>
<td style="text-align:left">int</td>
<td style="text-align:left">地图列表总数</td>
</tr>
<tr>
<td style="text-align:left">mapList</td>
<td style="text-align:left">array</td>
<td style="text-align:left">地图列表数据</td>
</tr>
<tr>
<td style="text-align:left">mapTime</td>
<td style="text-align:left">string</td>
<td style="text-align:left">地图文件生成时间</td>
</tr>
<tr>
<td style="text-align:left">tasks</td>
<td style="text-align:left">array</td>
<td style="text-align:left">该地图名称绑定的任务列表</td>
</tr>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">地图名称</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">int</td>
<td style="text-align:left">地图唯一标识符</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>python 案例</p>
<pre data-role="codeBlock" data-info="python" class="language-python python"><code><span class="token keyword keyword-import">import</span> requests

url <span class="token operator">=</span> <span class="token string">"http://localhost/apiUrl/map_list?page=1&amp;limit=-1&amp;sortType=&amp;reverse="</span>

payload<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
files<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
headers <span class="token operator">=</span> <span class="token punctuation">{</span>
<span class="token string">'Authorization'</span><span class="token punctuation">:</span> <span class="token string">'MTY3NTg0Njk2NC4xMjk1NjgzJDdmOGEzOTIzNTJmZTAxYzFkOGQ4ZDc1ZTdmMTYzMjBkN2FjNGE0NjM='</span>
<span class="token punctuation">}</span>

response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"GET"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">,</span> data<span class="token operator">=</span>payload<span class="token punctuation">,</span> files<span class="token operator">=</span>files<span class="token punctuation">)</span>

</code></pre></li>
</ul>
<h4 id="获取某个地图信息">获取某个地图信息 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/map_info?mapName=">http://localhost/apiUrl/map_info?mapName=</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取单个地图单个任务信息，包含宽度高度，原点坐标，任务列表等信息</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
mapName 参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"mapInfo"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"gridHeight"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"gridWidth"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"originX"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"originY"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"resolution"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"tasks"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">"aa"</span><span class="token punctuation">,</span><span class="token string">"bb"</span><span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">mapInfo</td>
<td style="text-align:left">object</td>
<td style="text-align:left">地图信息数据体</td>
</tr>
<tr>
<td style="text-align:left">gridHeight</td>
<td style="text-align:left">int</td>
<td style="text-align:left">地图图片高度</td>
</tr>
<tr>
<td style="text-align:left">gridWidth</td>
<td style="text-align:left">int</td>
<td style="text-align:left">地图图片宽度</td>
</tr>
<tr>
<td style="text-align:left">originX</td>
<td style="text-align:left">float</td>
<td style="text-align:left">地图图片建图原点X坐标</td>
</tr>
<tr>
<td style="text-align:left">originY</td>
<td style="text-align:left">float</td>
<td style="text-align:left">地图图片建图原点Y坐标</td>
</tr>
<tr>
<td style="text-align:left">resolution</td>
<td style="text-align:left">float</td>
<td style="text-align:left">地图图片分辨率</td>
</tr>
<tr>
<td style="text-align:left">tasks</td>
<td style="text-align:left">array</td>
<td style="text-align:left">地图绑定的任务列表</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="下载某个地图图片">下载某个地图图片 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/downloadpng?mapName=">http://localhost/apiUrl/downloadpng?mapName=</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取单个地图图片，即下载地图png</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
<code>mapName</code>:地图文件名称<br>
mapName 参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取</p>
</li>
<li>
<p><strong>应答数据:</strong><br>
返回map_name地图文件，png格式<br>
<img src="7103.png" alt="filename"></p>
</li>
</ul>
<h4 id="重命名某个地图">重命名某个地图 </h4>
<ul>
<li>
<p><strong>post请求:</strong><br>
<a href="http://localhost/apiUrl/rename_map">http://localhost/apiUrl/rename_map</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值<br>
Content-Type: application/form-data;</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
将某个地图重命名</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
body json 数据<br>
mapName 参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> 
    <span class="token property">"newMapName"</span><span class="token operator">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">原地图名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">newMapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">新地图名称</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> 
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> 
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="删除地图文件">删除地图文件 </h4>
<ul>
<li>
<p><strong>delete请求:</strong><br>
<a href="http://localhost/apiUrl/delete_map?mapName=">http://localhost/apiUrl/delete_map?mapName=</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
将某个地图删除，不可恢复</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
mapName 参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取</p>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="导出某个地图包">导出某个地图包 </h4>
<ul>
<li>
<p><strong>GET请求:</strong></p>
<p><a href="http://localhost/apiUrl/download_map_zip?id=">http://localhost/apiUrl/download_map_zip?id=</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
导出地图包，包含地图png图片，.pcd文件，.yaml文件</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
<code>id</code>:地图唯一标识符, 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取</p>
</li>
<li>
<p><strong>应答数据:</strong><br>
响应标头 Content-Type: application/octet-stream<br>
返回map_name地图压缩包文件，文件名称为 id.zip,存储参数Content-Disposition中，如下所示:"Content-Disposition":"attachment; filename=1704269180.zip".<br>
<strong>注意</strong>导入地图时需要将id.zip 改成压缩包中的地图名,比如1704269180.zip中地图名为aa.png,将1704269180.zip 重命名为aa.zip,才能导入成功。</p>
</li>
</ul>
<h4 id="导入某个地图包">导入某个地图包 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/upload_map_zip">http://localhost/apiUrl/upload_map_zip</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值<br>
Content-Type: application/form-data;</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
上传单个地图zip格式的压缩包文件,文件来自于<strong>导出某个地图包</strong>接口，<br>
文件格式以及文件夹形式不能改动，需要保证与导出的地图包一致。</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
表单数据 {<code>file</code>: 二进制文件}<br>
请求标头 Content-Type:form-data</p>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="批量导出地图包">批量导出地图包 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/download_map_list">http://localhost/apiUrl/download_map_list</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
根据地图列表接口中的 获取到的地图信息中的"id"字段，下载对应地图汇总合集压缩包</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
表单json数据<br>
id 参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">[</span>
  <span class="token number">111</span><span class="token punctuation">,</span><span class="token number">2222</span>
<span class="token punctuation">]</span>  
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">int array</td>
<td style="text-align:left">地图列表中地图id 字段合集</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
</li>
</ul>
<p>返回所有需要下载的地图合集压缩包，zip格式</p>
<h3 id="任务相关接口">任务相关接口 </h3>
<p><a id="jump_12" href=""></a></p>
<h4 id="地图图片坐标转成地图坐标">地图图片坐标转成地图坐标 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/get_map/positon?mapName=office&amp;pngX=960&amp;pngY=275">http://localhost/apiUrl/get_map/positon?mapName=office&amp;pngX=960&amp;pngY=275</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
将某张地图图片的像素坐标转成地图坐标，得到底层导航系统所需的地图坐标</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取<br>
<code>mapName</code>:地图名称<br>
<code>pngX</code>:图片像素坐标点的x点<br>
<code>pngY</code>:图片像素坐标点的y点</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"map_pose_x"</span><span class="token operator">:</span> <span class="token number">-3.5258370000000028</span><span class="token punctuation">,</span>
        <span class="token property">"map_pose_y"</span><span class="token operator">:</span> <span class="token number">35.104293000000006</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">map_pose_x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">导航系统地图坐标x点</td>
</tr>
<tr>
<td style="text-align:left">map_pose_x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">导航系统地图坐标y点</td>
</tr>
</tbody>
</table>
</li>
</ul>
<p><a id="jump_13" href=""></a></p>
<h4 id="地图坐标转成图片像素坐标">地图坐标转成图片像素坐标 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/get_world/positon?mapName=office&amp;poseX=-3.5258370&amp;poseY=35.104293">http://localhost/apiUrl/get_world/positon?mapName=office&amp;poseX=-3.5258370&amp;poseY=35.104293</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
将某张地图的地图坐标转成地图图片的像素，转换公式详情参考 <strong><a href="#jump_11">坐标转换</a></strong></p>
</li>
<li>
<p><strong>请求参数:</strong><br>
参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取<br>
<code>mapName</code>:地图名称<br>
<code>poseX</code>:地图坐标点的x点<br>
<code>poseY</code>:地图坐标点的y点</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"png_pose_x"</span><span class="token operator">:</span> <span class="token number">960.0</span><span class="token punctuation">,</span>
        <span class="token property">"png_pose_y"</span><span class="token operator">:</span> <span class="token number">275.0000000000001</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">png_pose_x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">图片像素坐标x点</td>
</tr>
<tr>
<td style="text-align:left">png_pose_y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">图片像素坐标y点</td>
</tr>
</tbody>
</table>
</li>
</ul>
<p><a id="jump_2" href=""></a></p>
<h4 id="获取某个地图某个任务信息">获取某个地图某个任务信息 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/get_tasks?mapName=xx&amp;taskName=xx">http://localhost/apiUrl/get_tasks?mapName=xx&amp;taskName=xx</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取某张地图对应的任务信息,填写position时需要填写地图坐标，如何获取地图坐标，请参考 <strong><a href="#jump_11">坐标转换</a></strong></p>
</li>
<li>
<p><strong>请求参数:</strong><br>
参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取<br>
<code>mapName</code>:地图名称<br>
<code>taskName</code>:任务名称</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"taskName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"gridItemIdx"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"points"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token property">"x"</span><span class="token operator">:</span>  <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token property">"theta"</span><span class="token operator">:</span>  <span class="token number">0</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"pointType"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"actions"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
                <span class="token property">"actionContent"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token property">"actionType"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token property">"actionOrder"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token property">"actionName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token property">"pointName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"index"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"isNew"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
            <span class="token property">"cpx"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"cpy"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"evadible"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"speed"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"editedName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"remark"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"personName"</span><span class="token operator">:</span> <span class="token string">""</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">taskName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务名称</td>
</tr>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">地图名称</td>
</tr>
<tr>
<td style="text-align:left">editedName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务需要重命名的名称</td>
</tr>
<tr>
<td style="text-align:left">personName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务创建人</td>
</tr>
<tr>
<td style="text-align:left">remark</td>
<td style="text-align:left">string</td>
<td style="text-align:left">备注信息</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务模式,"point":多点导航 "path":路径导航</td>
</tr>
<tr>
<td style="text-align:left">evadible</td>
<td style="text-align:left">int</td>
<td style="text-align:left">避障模式，1：避障，2：停障</td>
</tr>
<tr>
<td style="text-align:left">gridItemIdx</td>
<td style="text-align:left">int</td>
<td style="text-align:left">web前端显示所需索引</td>
</tr>
<tr>
<td style="text-align:left">speed</td>
<td style="text-align:left">float</td>
<td style="text-align:left">导航时速度参数0.1~1.5(M/S)</td>
</tr>
<tr>
<td style="text-align:left">points</td>
<td style="text-align:left">array</td>
<td style="text-align:left">任务点列表，详情参考下方的任务点参数表</td>
</tr>
</tbody>
</table>
<p>任务点参数表</p>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">position</td>
<td style="text-align:left">object</td>
<td style="text-align:left">子任务点位置坐标</td>
</tr>
<tr>
<td style="text-align:left">x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">子任务点位置X坐标</td>
</tr>
<tr>
<td style="text-align:left">y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">子任务点位置y坐标</td>
</tr>
<tr>
<td style="text-align:left">theta</td>
<td style="text-align:left">float</td>
<td style="text-align:left">子任务点位置X角度</td>
</tr>
<tr>
<td style="text-align:left">pointType</td>
<td style="text-align:left">string</td>
<td style="text-align:left">子任务点类型,可填值"navigation":导航点，"charge":充电点,未填写值时，默认为导航点</td>
</tr>
<tr>
<td style="text-align:left">isNew</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">注意只有"mode"="path"的路径模式下有效，决定该点是否为新路径的起点</td>
</tr>
<tr>
<td style="text-align:left">index</td>
<td style="text-align:left">int</td>
<td style="text-align:left">导航点索引</td>
</tr>
<tr>
<td style="text-align:left">cpx</td>
<td style="text-align:left">float</td>
<td style="text-align:left">曲线点x坐标，注意只有"mode"="path"的路径模式下，曲线点有效，将线段上的某个点作为贝塞尔曲线点</td>
</tr>
<tr>
<td style="text-align:left">cpy</td>
<td style="text-align:left">float</td>
<td style="text-align:left">曲线点y坐标，注意只有"mode"="path"的路径模式下，曲线点有效，将线段上的某个点作为贝塞尔曲线点</td>
</tr>
<tr>
<td style="text-align:left">actions</td>
<td style="text-align:left">array</td>
<td style="text-align:left">子任务点上的动作列表，当前版本只支持一个动作,第一个动作</td>
</tr>
<tr>
<td style="text-align:left">actionContent</td>
<td style="text-align:left">string</td>
<td style="text-align:left">执行动作时长，秒数</td>
</tr>
<tr>
<td style="text-align:left">actionType</td>
<td style="text-align:left">string</td>
<td style="text-align:left">动作类型,可填值"rotation":选择,"stop":停止</td>
</tr>
<tr>
<td style="text-align:left">actionName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">动作名称</td>
</tr>
<tr>
<td style="text-align:left">actionOrder</td>
<td style="text-align:left">int</td>
<td style="text-align:left">执行动作序号，0为最先处理动作</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置某个地图的某个任务信息">设置某个地图的某个任务信息 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/set_task">http://localhost/apiUrl/set_task</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
设置某个地图的某个任务信息,填写position时需要填写地图坐标，如何获取地图坐标，请参考 <strong><a href="#jump_11">坐标转换</a></strong></p>
</li>
<li>
<p><strong>请求参数:</strong><br>
表单json数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"taskName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"gridItemIdx"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"points"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
        <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"x"</span><span class="token operator">:</span>  <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"theta"</span><span class="token operator">:</span>  <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"pointType"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"actions"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            <span class="token property">"actionContent"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"actionType"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"actionOrder"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"actionName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"pointName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"index"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"isNew"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
        <span class="token property">"cpx"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"cpy"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"evadible"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
    <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"speed"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"editedName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"remark"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"personName"</span><span class="token operator">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><p>请求参数与接口<code>获取某个地图某个任务信息</code>一致，详情请参考 <strong><a href="#jump_2">获取某个地图某个任务信息</a></strong></p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> 
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="删除某个地图的某个任务">删除某个地图的某个任务 </h4>
<ul>
<li>
<p><strong>delete请求:</strong><br>
<a href="http://localhost/apiUrl/delete_task?mapName=222&amp;taskName=2222">http://localhost/apiUrl/delete_task?mapName=222&amp;taskName=2222</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
将某个地图的任务进行删除操作，不可恢复</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">地图名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">taskName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务名称</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> 
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<p><a id="jump_15" href=""></a></p>
<h4 id="对当前导航的地图执行实时任务">对当前导航的地图执行实时任务 </h4>
<ul>
<li>
<p><strong>post请求:</strong><br>
<a href="http://localhost/apiUrl/realtime_task">http://localhost/apiUrl/realtime_task</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
已经开启使用某张地图开启了导航的前提下，进行实时任务<br>
<strong>注意</strong></p>
<ul>
<li>查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong> ,</li>
<li>填写position时需要填写地图坐标，如何获取地图坐标，请参考 <strong><a href="#jump_11">坐标转换</a></strong></li>
</ul>
</li>
<li>
<p><strong>请求参数:</strong><br>
body json 数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"loopTime"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> 
    <span class="token property">"points"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span> 
        <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"theta"</span><span class="token operator">:</span> <span class="token number">0</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"isNew"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
        <span class="token property">"cpx"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"cpy"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">loop</td>
<td style="text-align:left">int</td>
<td style="text-align:left">循环次数,等于0时会一直循环</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">导航类型,可能值"point":多点导航 "path":多路径导航</td>
</tr>
<tr>
<td style="text-align:left">points</td>
<td style="text-align:left">array</td>
<td style="text-align:left">任务点点列表</td>
</tr>
<tr>
<td style="text-align:left">position</td>
<td style="text-align:left">object</td>
<td style="text-align:left">单个子任务点信息</td>
</tr>
<tr>
<td style="text-align:left">x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">子任务点位置X坐标</td>
</tr>
<tr>
<td style="text-align:left">y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">子任务点位置y坐标</td>
</tr>
<tr>
<td style="text-align:left">theta</td>
<td style="text-align:left">float</td>
<td style="text-align:left">子任务点位置角度 (子任务点相对原点x轴)，如果子任务坐标是机器人当前位置，可将机器人位置数据中所得到四元数转换成角度使用，转换函数请参考python demo 中的 <strong><a href="#jump_8">quaternion_to_euler</a></strong></td>
</tr>
<tr>
<td style="text-align:left">isNew</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">注意只有"mode"="path"的路径模式下有效，决定该点是否为新路径的起点</td>
</tr>
<tr>
<td style="text-align:left">cpx</td>
<td style="text-align:left">float</td>
<td style="text-align:left">曲线点x坐标，注意只有"mode"="path"的路径模式下，曲线点有效，将线段上的某个点作为贝塞尔曲线点</td>
</tr>
<tr>
<td style="text-align:left">cpy</td>
<td style="text-align:left">float</td>
<td style="text-align:left">曲线点y坐标，注意只有"mode"="path"的路径模式下，曲线点有效，将线段上的某个点作为贝塞尔曲线点</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> 
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="对当前导航的地图执行列表任务">对当前导航的地图执行列表任务 </h4>
<ul>
<li>
<p><strong>post请求:</strong><br>
<a href="http://localhost/apiUrl/run_list_task">http://localhost/apiUrl/run_list_task</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
已经开启使用某张地图开启了导航的前提下，选择任务列表中的某项任务，执行任务<br>
<strong>注意</strong> 查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong></p>
</li>
<li>
<p><strong>请求参数:</strong><br>
body json 数据<br>
参数值 从 <strong><a href="#jump_1">获取地图列表</a></strong> 接口中获取到地图列表中获取</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"taskName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"loopTime"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">地图名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">taskName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">loopTime</td>
<td style="text-align:left">int</td>
<td style="text-align:left">&gt;0: 循环次数，0:无限循环</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="版本信息">版本信息 </h3>
<h4 id="获取软件版本信息">获取软件版本信息 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/version_info">http://localhost/apiUrl/version_info</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取软件版本信息，包含三个版本,navisBrian,navisBridge, navisBoard</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
无</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"Navis Board"</span><span class="token punctuation">,</span>
        <span class="token property">"version"</span><span class="token operator">:</span> <span class="token string">"0.8.1.20230201_beta1"</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"Navis Brain"</span><span class="token punctuation">,</span>
        <span class="token property">"version"</span><span class="token operator">:</span> <span class="token string">"0.0.16.0109_beta"</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"Navis Bridge"</span><span class="token punctuation">,</span>
        <span class="token property">"version"</span><span class="token operator">:</span> <span class="token string">"0.0.2.0201_beta"</span>
    <span class="token punctuation">}</span><span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">程序类型，可能值有以下  Navis Board":web程序版本,"Navis Brain":ros 程序版本,"Navis Bridge":服务器程序版本</td>
</tr>
<tr>
<td style="text-align:left">version</td>
<td style="text-align:left">string</td>
<td style="text-align:left">程序版本</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取设备版本信息">获取设备版本信息 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/dev_version">http://localhost/apiUrl/dev_version</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取硬件设备版本信息，包含移动平台、激光雷达传感器、惯性传感器、视觉传感器、核心计算单元</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
无</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"computer"</span><span class="token punctuation">,</span>
            <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"X-7010"</span><span class="token punctuation">,</span>
            <span class="token property">"s_version"</span><span class="token operator">:</span> <span class="token string">"---"</span><span class="token punctuation">,</span>
            <span class="token property">"h_version"</span><span class="token operator">:</span> <span class="token string">"---"</span>
        <span class="token punctuation">}</span>
        
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">array</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">硬件具体型号</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">程序版本</td>
</tr>
<tr>
<td style="text-align:left">s_version</td>
<td style="text-align:left">string</td>
<td style="text-align:left">硬件中的软件程序版本</td>
</tr>
<tr>
<td style="text-align:left">h_version</td>
<td style="text-align:left">string</td>
<td style="text-align:left">硬件中的固件版本</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="相机相关接口">相机相关接口 </h3>
<pre class="language-text">需要配备导航套件中的海康相机一起使用，若无海康相机，可忽略相机相关api接口
</pre>
<p><a id="jump_5" href=""></a></p>
<h4 id="获取相机列表">获取相机列表 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/get_camera_list">http://localhost/apiUrl/get_camera_list</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取相机列表参数。</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
无</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"total"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"streams"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"cameraId"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token property">"cameraName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token property">"onDemand"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
                <span class="token property">"disableAudio"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
                <span class="token property">"rtspUrl"</span><span class="token operator">:</span> <span class="token string">""</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">total</td>
<td style="text-align:left">int</td>
<td style="text-align:left">相机视频流总数</td>
</tr>
<tr>
<td style="text-align:left">streams</td>
<td style="text-align:left">array</td>
<td style="text-align:left">相机视频流数组 ,没有添加过相机视频流时为空数组</td>
</tr>
<tr>
<td style="text-align:left">cameraId</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机ID 唯一标识符</td>
</tr>
<tr>
<td style="text-align:left">cameraName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机名称</td>
</tr>
<tr>
<td style="text-align:left">onDemand</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否是主视频流</td>
</tr>
<tr>
<td style="text-align:left">disableAudio</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否使用音频</td>
</tr>
<tr>
<td style="text-align:left">rtspUrl</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机rtsp 视频流地址</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="添加相机视频流">添加相机视频流 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/add_camera">http://localhost/apiUrl/add_camera</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
添加相机流参数，并存储到视频流列表。</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"cameraId"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"cameraName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"onDemand"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"disableAudio"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"rtspUrl"</span><span class="token operator">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">cameraId</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机id,需要保证唯一性,不能与其他cameraId重复, <strong><a href="#jump_5">获取相机ID列表</a></strong></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">cameraName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">onDemand</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否是主视频流</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">disableAudio</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否使用音频</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">rtspUrl</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机rtsp 视频流地址</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> 
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> 
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置某个相机视频流">设置某个相机视频流 </h4>
<ul>
<li>
<p><strong>post请求:</strong><br>
<a href="http://localhost/apiUrl/set_camera">http://localhost/apiUrl/set_camera</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
根据相机ID来设置相机流参数，并存储到视频流列表。</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"cameraId"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"cameraName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"onDemand"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"disableAudio"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"rtspUrl"</span><span class="token operator">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">cameraId</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机id,需要保证唯一性，不能与其他cameraId重复 <strong><a href="#jump_5">获取相机ID列表</a></strong></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">cameraName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">onDemand</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否是主视频流</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">disableAudio</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否使用音频</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">rtspUrl</td>
<td style="text-align:left">string</td>
<td style="text-align:left">相机rtsp 视频流地址</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> 
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token comment">// </span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="删除某个相机视频流">删除某个相机视频流 </h4>
<ul>
<li>
<p><strong>delete请求:</strong><br>
<a href="http://localhost/apiUrl/delete_camera?cameraId=">http://localhost/apiUrl/delete_camera?cameraId=</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
将视频流列表中的某个视频流信息删除，不可恢复</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
<strong><a href="#jump_5">获取相机ID列表</a></strong><br>
cameraId = 需要删除的相机id</p>
</li>
<li>
<p><strong>应答数据:</strong><br>
标准应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> 
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> 
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span><span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="定时任务相关接口">定时任务相关接口 </h3>
<h4 id="获取定时任务列表">获取定时任务列表 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/cron/tasklist?limit=10&amp;page=1">http://localhost/apiUrl/cron/tasklist?limit=10&amp;page=1</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
查询定时任务列表信息</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
<code>limit</code>:一页的数量多少<br>
<code>page</code>:获取第几页</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"total"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"list"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"b69e7af6-4d33-4609-b016-642e6957a9ef"</span><span class="token punctuation">,</span>
                <span class="token property">"state"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
                <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">"mission-system1"</span><span class="token punctuation">,</span>
                <span class="token property">"taskName"</span><span class="token operator">:</span> <span class="token string">"aaa"</span><span class="token punctuation">,</span>
                <span class="token property">"description"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token property">"tasklist"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                    <span class="token string">"测试示教点"</span>
                <span class="token punctuation">]</span><span class="token punctuation">,</span>
                <span class="token property">"value"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                    <span class="token string">"2024-02-06"</span>
                <span class="token punctuation">]</span><span class="token punctuation">,</span>
                <span class="token property">"range"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                    
                <span class="token punctuation">]</span><span class="token punctuation">,</span>
                <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token string">"date"</span><span class="token punctuation">,</span>
                <span class="token property">"time"</span><span class="token operator">:</span> <span class="token string">"13:53"</span><span class="token punctuation">,</span>
                <span class="token property">"createTime"</span><span class="token operator">:</span> <span class="token string">"2024-02-06 13:51:12"</span><span class="token punctuation">,</span>
                <span class="token property">"updateTime"</span><span class="token operator">:</span> <span class="token string">"2024-02-18 10:17:39"</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">total</td>
<td style="text-align:left">int</td>
<td style="text-align:left">定时任务列表总数</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">定时任务id</td>
</tr>
<tr>
<td style="text-align:left">state</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">任务当前状态，true:开启, false:关闭</td>
</tr>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">该任务使用的地图</td>
</tr>
<tr>
<td style="text-align:left">taskName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">定时任务名称</td>
</tr>
<tr>
<td style="text-align:left">description</td>
<td style="text-align:left">string</td>
<td style="text-align:left">对任务的描述，用于前端显示</td>
</tr>
<tr>
<td style="text-align:left">tasklist</td>
<td style="text-align:left">arary</td>
<td style="text-align:left">该定时任务使用到的列表任务</td>
</tr>
<tr>
<td style="text-align:left">value</td>
<td style="text-align:left">arary</td>
<td style="text-align:left">根据mode字段的值决定,<div>mode=week,则value：['2','5']表示每周二、周五, 0表示周日,1-6表示周一至周六;</div> <div>mode=separate则value：[‘3’]表示每隔3天;</div> <div>mode=date则value：['2023-12-24']代表这一天的某时刻;</div> <div>mode=forbit则value：不用填，直接看range的范围代表禁用</div></td>
</tr>
<tr>
<td style="text-align:left">range</td>
<td style="text-align:left">arary</td>
<td style="text-align:left">时间段范围，日期级，如 ['2023-11-15','2024-1-20']</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">定时任务模式,<div>week:固定周几执行模式;</div><div>date:指定某日期某时刻模式;</div><div>forbit:指定时间段禁止执行模式;</div><div>separate:隔几天执行模式</div></td>
</tr>
<tr>
<td style="text-align:left">time</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体的时刻,秒级 如13:14:15</td>
</tr>
<tr>
<td style="text-align:left">createTime</td>
<td style="text-align:left">string</td>
<td style="text-align:left">创建时间</td>
</tr>
<tr>
<td style="text-align:left">updateTime</td>
<td style="text-align:left">string</td>
<td style="text-align:left">更新时间</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置定时任务状态">设置定时任务状态 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/set/cron/state">http://localhost/apiUrl/set/cron/state</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
切换固定id的定时任务状态</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"116"</span><span class="token punctuation">,</span>
    <span class="token property">"state"</span><span class="token operator">:</span> <span class="token boolean">false</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">定时任务id</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">state</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态值,true:开启,false:关闭</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取新增设备列表">获取新增设备列表 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/plus/device?type=arm">http://localhost/apiUrl/plus/device?type=arm</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
查询定时任务列表信息</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
<code>type</code>:设备类型,共三种arm:机械臂,camera:RGB相机;lifter:升降杆，根据type得到对应的设备列表。</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/19"</span><span class="token punctuation">,</span>
            <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"RM"</span><span class="token punctuation">,</span>
            <span class="token property">"config"</span><span class="token operator">:</span> <span class="token string">"192.168.1.19"</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">object</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备id</td>
</tr>
<tr>
<td style="text-align:left">name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备名称</td>
</tr>
<tr>
<td style="text-align:left">config</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备配置参数,不同的设备，参数不一致</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="保存新增设备">保存新增设备 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/plus/device">http://localhost/apiUrl/plus/device</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
只有验证通过之后才能保存该设备，否则将无法执行该设备动作。</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/163"</span><span class="token punctuation">,</span>
    <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"哈哈"</span><span class="token punctuation">,</span>
    <span class="token property">"config"</span><span class="token operator">:</span> <span class="token string">"192.168.1.163"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">config</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备所需的配置参数，<div>机械臂设备config=ip,例如"192.168.1.2";</div><div>升降杆设备config=驱动端口号,例如"1"; </div><div>相机设备type=相机序列码,例如"020522071209" </div></td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">格式:type_config,<div>机械臂设备type=arm,例如arm_192/168/1/2;</div><div>升降杆设备type=lifter,例如lifter_1;</div><div>相机设备type=camera例如camera_020522071209</div></td>
<td style="text-align:left"></td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span>      
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取设备动作列表">获取设备动作列表 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/get_action_list">http://localhost/apiUrl/get_action_list</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
查询所有设备动作列表信息，包含机器人本身固定动作，外加设备的动作。</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
无</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">"deviceType"</span><span class="token operator">:</span> <span class="token string">"latency"</span><span class="token punctuation">,</span>
            <span class="token property">"children"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                <span class="token punctuation">{</span>
                    <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"latency_timer"</span><span class="token punctuation">,</span>
                    <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"延时器"</span><span class="token punctuation">,</span>
                    <span class="token property">"action"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                        <span class="token punctuation">{</span>
                            <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"latency"</span><span class="token punctuation">,</span>
                            <span class="token property">"min"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                            <span class="token property">"max"</span><span class="token operator">:</span> <span class="token number">3600</span><span class="token punctuation">,</span>
                            <span class="token property">"contentOptions"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"1"</span><span class="token punctuation">,</span><span class="token string">"5"</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                            <span class="token property">"units"</span><span class="token operator">:</span> <span class="token string">"s"</span>
                        <span class="token punctuation">}</span>
                    <span class="token punctuation">]</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">]</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">object</td>
<td style="text-align:left">应答数据</td>
</tr>
<tr>
<td style="text-align:left">deviceType</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备类型 <div>robot:机器人本体; </div> <div>camera:RGB相机; </div> <div>latency:延时动作; </div> <div>audio:音频资源; </div> <div>lifter:升降杆; </div> <div>arm:机械臂; </div> <div>camera:RGB相机; </div></td>
</tr>
<tr>
<td style="text-align:left">children</td>
<td style="text-align:left">array</td>
<td style="text-align:left">设备列表，可能存在多个同类型设备</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备id  默认设备id <div> deviceType=robot,id=root; </div> <div> deviceType=latency,id=latency_timer; </div> <div> deviceType=audio,id=audio_player </div><div>外加设备id根据添加时的id决定</div></td>
</tr>
<tr>
<td style="text-align:left">name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备名称</td>
</tr>
<tr>
<td style="text-align:left">action</td>
<td style="text-align:left">arary</td>
<td style="text-align:left">设备动作列表，可能存在多个动作</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">动作类型  <div> deviceType=robot,type=stop(停止秒数)/rotate(旋转角度)/move(直线运动); </div></td>
</tr>
<tr>
<td style="text-align:left">min</td>
<td style="text-align:left">int</td>
<td style="text-align:left">动作参数最小值，如果 contentOptions=[0,1]时 min=1</td>
</tr>
<tr>
<td style="text-align:left">max</td>
<td style="text-align:left">int</td>
<td style="text-align:left">动作参数最大值,如果 contentOptions=[0,1]时 max=1</td>
</tr>
<tr>
<td style="text-align:left">contentOptions</td>
<td style="text-align:left">string array</td>
<td style="text-align:left">动作参数 列表  机械臂填写参数为六轴角度  "0,0,0,0,0,0",其他类型设备为单个数字"10","1",可以有多个</td>
</tr>
<tr>
<td style="text-align:left">units</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数的单位</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="新增设备增加动作">新增设备增加动作 </h4>
<ul>
<li>
<p><strong>GET请求:</strong><br>
<a href="http://localhost/apiUrl/device/action">http://localhost/apiUrl/device/action</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
查询所有设备动作列表信息，包含机器人本身固定动作，外加设备的动作。</p>
</li>
<li>
<p><strong>请求参数:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/18"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"moveit"</span><span class="token punctuation">,</span>
    <span class="token property">"contentOptions"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">"0,0,0,0,0,0"</span><span class="token punctuation">,</span>
        <span class="token string">"-6.3,69.7,-169.9,13.4,131.4,61.3"</span><span class="token punctuation">,</span>
        <span class="token string">"0,0,250,0,-100,0"</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">新增设备的id</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备动作类型&nbsp; <div>lifter: 升降杆</div><div>camera: RGB相机</div><div>arm: 机械臂</div><div>robot:机器人本体</div><div>grab: 夹爪</div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">contentOptions</td>
<td style="text-align:left">array</td>
<td style="text-align:left">动作参数值数组</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span>      
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="软件中断动作恢复接口">软件中断动作，恢复接口 </h4>
<ul>
<li>
<p><strong>POST请求:</strong><br>
<a href="http://localhost/apiUrl/resume_node">http://localhost/apiUrl/resume_node</a></p>
</li>
<li>
<p><strong>请求头部:</strong><br>
Authorization:从/login接口返回的数据中获取值</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
当定时任务执行到"软件中断等待恢复"动作时,用于恢复动作流程。</p>
</li>
<li>
<p><strong>请求参数:</strong><br>
无</p>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">"成功"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span>      
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">状态码，优先判断该状态码,返回0即表示成功,-1表示失败</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">状态描述</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h2 id="websocket-api">websocket API </h2>
<ul>
<li><strong>服务器地址</strong><br>
机器人本地服务器ip地址+9090，视具体情况而定，如ws://192.168.1.1:9090</li>
</ul>
<h3 id="通用指令介绍">通用指令介绍 </h3>
<h4 id="subcribe请求">SUBCRIBE请求 </h4>
<ul>
<li>
<p>通用请求数据格式<br>
<strong>注意</strong><br>
订阅请求（Subscribe）是 WebSocket 客户端发送一次即可。如果服务端有对应的主题（Topic）数据，则客户端会<strong>持续</strong>接收该话题数据, 取消接收该话题数据有两种方式:1.与服务器断开连接, 2. 将op字段的值"subscribe"改成"unsubscribe"。如果发送subscribe请求没有收到数据，可能是主题名称拼写错误或者服务端不存在对应的主题数据，如果发送unsubscribe请求，将不会再收到该话题数据。</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> 
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅 , "unsubscribe":取消订阅,不再收到该话题数据</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题对应的类型</td>
<td style="text-align:left">否   (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>通用应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> 
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"publish":回复"subscribe"操作</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe"操作中的话题</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体的消息数据</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="call_service请求">CALL_SERVICE请求 </h4>
<ul>
<li>
<p>通用请求数据格式<br>
<strong>注意</strong><br>
服务调用请求（Call Service）是类似http请求,客户端每发送一次请求,服务端收到后会返回一次响应数据。发送一次，响应一次。如果客户端没有收到数据,可能是服务名称拼写错误或者服务端不存在对应的service。</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> 
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span> 
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"call_service":调用服务</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务对应的类型</td>
<td style="text-align:left">否   (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务所需参数</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>通用应答数据</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> 
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"service_response":回复"call_service"操作</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体的消息数据</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">通信是否正常，请求是否成功</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="publish请求">PUBLISH请求 </h4>
<ul>
<li>通用请求数据格式<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"话题名称"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">":geometry_msgs/Twist"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span> 
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"publish":发布数据</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题对应的类型</td>
<td style="text-align:left">否   (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">发布数据所需对应类型的具体数据</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>注意:publish没有应答数据，必要时需要查看机器人本身状态，比如移动控制指令</li>
</ul>
<h4 id="通用案例">通用案例 </h4>
<ul>
<li>
<p>可根据请求数据更改message</p>
<pre data-role="codeBlock" data-info="python" class="language-python python"><code><span class="token comment">#-*-coding:utf-8-*-</span>
<span class="token keyword keyword-import">import</span> asyncio
<span class="token keyword keyword-import">import</span> websockets
<span class="token keyword keyword-import">import</span> json

<span class="token comment">## 根据实际填写请求数据</span>
message <span class="token operator">=</span> <span class="token punctuation">{</span> 
    <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/uptime"</span>
<span class="token punctuation">}</span>

<span class="token keyword keyword-async">async</span> <span class="token keyword keyword-def">def</span> <span class="token function">send_data</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    uri <span class="token operator">=</span> <span class="token string">"ws://localhost:9090"</span> <span class="token comment">#填写实际的机器人IP地址</span>
    <span class="token keyword keyword-async">async</span> <span class="token keyword keyword-with">with</span> websockets<span class="token punctuation">.</span>connect<span class="token punctuation">(</span>uri<span class="token punctuation">)</span> <span class="token keyword keyword-as">as</span> websocket<span class="token punctuation">:</span>
       
        <span class="token keyword keyword-await">await</span> websocket<span class="token punctuation">.</span>send<span class="token punctuation">(</span><span class="token builtin">bytes</span><span class="token punctuation">(</span>json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>message<span class="token punctuation">,</span> ensure_ascii<span class="token operator">=</span><span class="token boolean">False</span><span class="token punctuation">)</span><span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">"utf-8"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        greeting <span class="token operator">=</span> <span class="token keyword keyword-await">await</span> websocket<span class="token punctuation">.</span>recv<span class="token punctuation">(</span><span class="token punctuation">)</span>

loop <span class="token operator">=</span> asyncio<span class="token punctuation">.</span>get_event_loop<span class="token punctuation">(</span><span class="token punctuation">)</span>
loop<span class="token punctuation">.</span>run_until_complete<span class="token punctuation">(</span>send_data<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
loop<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre></li>
</ul>
<h4 id="注意事项-1">注意事项 </h4>
<ol>
<li>请求数据中的"type"字段，本意为话题名称对应的数据类型,非必填字段，仅在使用roslib.js时使用必填,未使用可忽略，后续不再做特殊说明</li>
</ol>
<h4 id="二次开发必要接口">(二次开发必要接口) </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
心跳指令：websocket客户端可间隔5秒发1次，用于检测连接，否则视为与服务器连接断开,服务器将会断开当前连接的客户端。<br>
详情 可以参考python demo中的发送心跳接口</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"ping"</span><span class="token punctuation">,</span>
    <span class="token property">"id"</span><span class="token operator">:</span><span class="token string">"aa1b2c-dd"</span><span class="token punctuation">,</span>
    <span class="token property">"timeStamp"</span><span class="token operator">:</span> <span class="token number">1681465384099</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"ping"</td>
</tr>
<tr>
<td style="text-align:left">timeStamp</td>
<td style="text-align:left">int</td>
<td style="text-align:left">客户端发送的时间戳，可用于计算通信延迟</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">客户端唯一标识符,英文+数字组成字符串,在每次启动ws client时生成。可用于与服务器重连</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"pong"</span><span class="token punctuation">,</span>
    <span class="token property">"timeStamp"</span><span class="token operator">:</span> <span class="token number">1681465384099</span><span class="token punctuation">,</span>
    <span class="token property">"serverTime"</span><span class="token operator">:</span> <span class="token number">1681465384099</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复类型,固定是"pong"</td>
</tr>
<tr>
<td style="text-align:left">timeStamp</td>
<td style="text-align:left">int</td>
<td style="text-align:left">客户端发送的时间戳，可用于计算通信延迟</td>
</tr>
<tr>
<td style="text-align:left">serverTime</td>
<td style="text-align:left">int</td>
<td style="text-align:left">服务端收到当前ping请求的时间</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="机器人状态信息">机器人状态信息 </h3>
<p><a id="jump_9" href=""></a></p>
<h4 id="设备当前状态">设备当前状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
机器人当前程序启动状态，监听录包、建图、导航程序是否开启，应答频率1hz（每秒1次）</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/slam_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"tools_msgs/slamStatus"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/slam_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"nav"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"state"</span><span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
            <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"task"</span><span class="token operator">:</span> <span class="token string">""</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"mapping_3d"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"state"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
            <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">""</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"mapping_2d"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"state"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
            <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">""</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"record"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"state"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
            <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">""</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">object</td>
<td style="text-align:left">回复"subscribe " "        固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">object</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">nav</td>
<td style="text-align:left">object</td>
<td style="text-align:left">导航状态信息</td>
</tr>
<tr>
<td style="text-align:left">mapping_3d</td>
<td style="text-align:left">object</td>
<td style="text-align:left">3D建图状态</td>
</tr>
<tr>
<td style="text-align:left">mapping_2d</td>
<td style="text-align:left">object</td>
<td style="text-align:left">2D建图状态</td>
</tr>
<tr>
<td style="text-align:left">record</td>
<td style="text-align:left">object</td>
<td style="text-align:left">录包状态</td>
</tr>
<tr>
<td style="text-align:left">state</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true-开启,false-关闭</td>
</tr>
<tr>
<td style="text-align:left">name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">正在导航的地图名称,或者当前录制的地图包名称</td>
</tr>
<tr>
<td style="text-align:left">task</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前地图正在使用的任务名称</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取机器人底盘数据">获取机器人底盘数据 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘上报的数据, 应答频率50hz（每秒50次）</p>
<p><strong>注意</strong> 本接口所有车型通用</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/interface_management/robot_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/RobotStatus"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/interface_management/robot_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"angular_velocity"</span><span class="token operator">:</span> <span class="token number">0.0</span><span class="token punctuation">,</span>
        <span class="token property">"fault_code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"base_state"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"linear_velocity"</span><span class="token operator">:</span> <span class="token number">0.0</span><span class="token punctuation">,</span>
        <span class="token property">"control_mode"</span><span class="token operator">:</span> <span class="token number">1</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">angular_velocity</td>
<td style="text-align:left">float</td>
<td style="text-align:left">当前角速度</td>
</tr>
<tr>
<td style="text-align:left">linear_velocity</td>
<td style="text-align:left">float</td>
<td style="text-align:left">当前线速度</td>
</tr>
<tr>
<td style="text-align:left">fault_code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">底盘错误信息反馈</td>
</tr>
<tr>
<td style="text-align:left">base_state</td>
<td style="text-align:left">int</td>
<td style="text-align:left">当前底盘状态 :0-正常状态</td>
</tr>
<tr>
<td style="text-align:left">control_mode</td>
<td style="text-align:left">int</td>
<td style="text-align:left">当前底盘控制模式 <div>0-空闲待机状态</div><div>1-CAN指令控制</div><div>2-串口控制(不支持)</div><div>3-手柄遥控控制</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取机器人电池状态">获取机器人电池状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘的电池状态，包括电量，电压等信息。应答频率50hz（每秒50次）<br>
<strong>注意</strong> 本接口以下车型不支持:scout-mini,不支持的车型将会得到参数值为0的应答数据</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/interface_management/BMS_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/RobotBmsStatus"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/interface_management/BMS_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"batteryCurrent"</span><span class="token operator">:</span> <span class="token number">0.0</span><span class="token punctuation">,</span>
        <span class="token property">"SOH"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"SOC"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"batteryTemperature"</span><span class="token operator">:</span> <span class="token number">0.0</span><span class="token punctuation">,</span>
        <span class="token property">"batteryVoltage"</span><span class="token operator">:</span> <span class="token number">0.0</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">batteryCurrent</td>
<td style="text-align:left">float</td>
<td style="text-align:left">电池电流</td>
</tr>
<tr>
<td style="text-align:left">batteryTemperature</td>
<td style="text-align:left">float</td>
<td style="text-align:left">电池温度</td>
</tr>
<tr>
<td style="text-align:left">batteryVoltage</td>
<td style="text-align:left">float</td>
<td style="text-align:left">电池电压</td>
</tr>
<tr>
<td style="text-align:left">SOH</td>
<td style="text-align:left">int</td>
<td style="text-align:left">电池健康状态</td>
</tr>
<tr>
<td style="text-align:left">SOC</td>
<td style="text-align:left">int</td>
<td style="text-align:left">电池电量</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取机器人充电信息">获取机器人充电信息 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘的充电信息，包括充电时长，总时长，次数等信息。应答频率1hz（每秒1次）<br>
<strong>注意</strong> 本接口以下车型不支持:scout-mini,不支持的车型将会得到参数值为0的应答数据</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/charge_data"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"board_ros/ChargeData"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/charge_data"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"charge_total_time"</span><span class="token operator">:</span> <span class="token number">75.89458465576172</span><span class="token punctuation">,</span>
        <span class="token property">"charge_status"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"charge_counts"</span><span class="token operator">:</span> <span class="token number">1298</span><span class="token punctuation">,</span>
        <span class="token property">"charge_single_time"</span><span class="token operator">:</span> <span class="token number">112.21366119384766</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">charge_total_time</td>
<td style="text-align:left">float</td>
<td style="text-align:left">累次充电时长(小时)</td>
</tr>
<tr>
<td style="text-align:left">charge_status</td>
<td style="text-align:left">int</td>
<td style="text-align:left">充电状态 0:未在充电  1:充电中</td>
</tr>
<tr>
<td style="text-align:left">charge_counts</td>
<td style="text-align:left">int</td>
<td style="text-align:left">累计充电次数</td>
</tr>
<tr>
<td style="text-align:left">charge_single_time</td>
<td style="text-align:left">float</td>
<td style="text-align:left">单次充电时长(小时)</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设备传感器状态">设备传感器状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
机器人上搭载的传感器启动状态，用于查看处于开启或者未开启状态。应答频率3hz（每秒3次）</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/sensor_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"tools_msgs/SensorStatus"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/sensor_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"imu_status"</span><span class="token operator">:</span> <span class="token string">"ON"</span><span class="token punctuation">,</span>
        <span class="token property">"lidar_status"</span><span class="token operator">:</span> <span class="token string">"ON"</span><span class="token punctuation">,</span>
        <span class="token property">"RTK_status"</span><span class="token operator">:</span> <span class="token string">"OFF"</span><span class="token punctuation">,</span>
        <span class="token property">"camera_status"</span><span class="token operator">:</span> <span class="token string">"OFF"</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe "  固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">lidar_status</td>
<td style="text-align:left">string</td>
<td style="text-align:left">雷达传感器是否开启: ON/OFF-开启/关闭</td>
</tr>
<tr>
<td style="text-align:left">imu_status</td>
<td style="text-align:left">string</td>
<td style="text-align:left">imu传感器是否开启: ON/OFF-开启/关闭</td>
</tr>
<tr>
<td style="text-align:left">camera_status</td>
<td style="text-align:left">string</td>
<td style="text-align:left">realsense相机是否开启: ON/OFF-开启/关闭</td>
</tr>
<tr>
<td style="text-align:left">RTK_status</td>
<td style="text-align:left">string</td>
<td style="text-align:left">RTK传感器是否开启: ON/OFF-开启/关闭</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="rtk-gps传感器数据">RTK-GPS传感器数据 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
注意:本接口需要配合配套的 RTK-GPS传感器使用，若无此传感器，可忽略。<br>
用于查看 RTK-GPS传感器数据</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/gnss_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"tools_msgs/GnssStatus"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/gnss_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"longitude"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"latitude"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"altitude"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"gps_qual"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"num_sats"</span><span class="token operator">:</span> <span class="token string">""</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">longitude</td>
<td style="text-align:left">string</td>
<td style="text-align:left">经度值</td>
</tr>
<tr>
<td style="text-align:left">latitude</td>
<td style="text-align:left">string</td>
<td style="text-align:left">纬度值</td>
</tr>
<tr>
<td style="text-align:left">altitude</td>
<td style="text-align:left">string</td>
<td style="text-align:left">海拔高度值</td>
</tr>
<tr>
<td style="text-align:left">num_sats</td>
<td style="text-align:left">int</td>
<td style="text-align:left">卫星数量</td>
</tr>
<tr>
<td style="text-align:left">gps_qual</td>
<td style="text-align:left">string</td>
<td style="text-align:left"><div>GPS状态&nbsp;&nbsp;</div><div>0:初始化</div><div>1:单点定位</div><div>2:码差分</div><div>3:无效PPS</div><div>4:固定解</div><div>5:浮点解</div><div>6:正在估算&nbsp;</div><div>7:人工输入固定值</div><div>8:模拟模式</div><div>9:WAAS差分&nbsp;&nbsp;</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="imu信息">imu信息 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上imu传感器数据，应答频率200hz（每秒200次）</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/imu/data"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"sensor_msgs/Imu"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/imu/data"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"linear_acceleration_covariance"</span><span class="token operator">:</span><span class="token punctuation">[</span><span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"orientation"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0.020334599539637566</span><span class="token punctuation">,</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">-0.03091932088136673</span><span class="token punctuation">,</span>
            <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">-0.4706343412399292</span><span class="token punctuation">,</span>
            <span class="token property">"w"</span><span class="token operator">:</span> <span class="token number">0.88155198097229</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"angular_velocity_covariance"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"orientation_covariance"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1681736356</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">290174861</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"base_link"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">16708127</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"linear_acceleration"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">-0.739708811044693</span><span class="token punctuation">,</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">-0.04365348890423775</span><span class="token punctuation">,</span>
            <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">9.873011016845703</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"angular_velocity"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0.0017316969721458107</span><span class="token punctuation">,</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">-3.1785856816228476e-05</span><span class="token punctuation">,</span>
            <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0.0005410258436915651</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe "  固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳  详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">linear_acceleration_covariance</td>
<td style="text-align:left">array</td>
<td style="text-align:left">线速度协方差</td>
</tr>
<tr>
<td style="text-align:left">angular_velocity_covariance</td>
<td style="text-align:left">array</td>
<td style="text-align:left">角速度协方差</td>
</tr>
<tr>
<td style="text-align:left">orientation_covariance</td>
<td style="text-align:left">array</td>
<td style="text-align:left">姿态协方差</td>
</tr>
<tr>
<td style="text-align:left">angular_velocity</td>
<td style="text-align:left">object</td>
<td style="text-align:left">imu的每条轴的角速度</td>
</tr>
<tr>
<td style="text-align:left">linear_acceleration</td>
<td style="text-align:left">object</td>
<td style="text-align:left">imu的每条轴的线速度</td>
</tr>
<tr>
<td style="text-align:left">orientation</td>
<td style="text-align:left">object</td>
<td style="text-align:left">imu的欧拉角标识的四元数</td>
</tr>
<tr>
<td style="text-align:left">x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">w</td>
<td style="text-align:left">float</td>
<td style="text-align:left">w轴的值（仅orientation有效）</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="激光雷达传感器3d点云数据">激光雷达传感器3D点云数据 </h4>
<ul>
<li>
<p><strong>注意事项:</strong><br>
前提条件：需要配备导航套件中的雷达传感器一起使用</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上搭载的激光雷达的3D点云数据，应答频率10hz（每秒10次）</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/points_raw"</span><span class="token punctuation">,</span>
    <span class="token property">"compression"</span><span class="token operator">:</span> <span class="token string">"cbor"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"sensor_msgs/PointCloud2"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题对应的类型</td>
<td style="text-align:left">否   (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
<tr>
<td style="text-align:left">compression</td>
<td style="text-align:left">string</td>
<td style="text-align:left">非必填,如果带有这条字段,发送端会对数据进行转成bytes传输，如果没有填写，则是默认的float数组数据</td>
<td style="text-align:left">否</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
根据请求数据是否携带<code>"compression": "cbor"</code>,作为区分方式。</p>
<ul>
<li>带有上述字段的应答形式为16进制的bytes,要想得到真正的数据，必须经过转码，将bytes 转换成 uint8 array</li>
<li>没有上述字段的应答形式为json + base64的形式，如下所示，要想得到真正的数据，必须经过base64解码得到bytes,再将其转换成uint8 array</li>
<li>具体转码案例请参考  <strong><a href="#jump_8">使用案例</a></strong> 中的<strong>订阅3D点云数据</strong>部分代码</li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/points_raw"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"width"</span><span class="token operator">:</span> <span class="token number">28119</span><span class="token punctuation">,</span>
        <span class="token property">"is_dense"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
        <span class="token property">"point_step"</span><span class="token operator">:</span> <span class="token number">22</span><span class="token punctuation">,</span>
        <span class="token property">"height"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1678272130</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">761749983</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"velodyne"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">50259</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"fields"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"datatype"</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
                <span class="token property">"count"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"x"</span><span class="token punctuation">,</span>
                <span class="token property">"offset"</span><span class="token operator">:</span> <span class="token number">0</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span>
                <span class="token property">"datatype"</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
                <span class="token property">"count"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"y"</span><span class="token punctuation">,</span>
                <span class="token property">"offset"</span><span class="token operator">:</span> <span class="token number">4</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span>
                <span class="token property">"datatype"</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
                <span class="token property">"count"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"z"</span><span class="token punctuation">,</span>
                <span class="token property">"offset"</span><span class="token operator">:</span> <span class="token number">8</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span>
                <span class="token property">"datatype"</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
                <span class="token property">"count"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"intensity"</span><span class="token punctuation">,</span>
                <span class="token property">"offset"</span><span class="token operator">:</span> <span class="token number">12</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span>
                <span class="token property">"datatype"</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>
                <span class="token property">"count"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"ring"</span><span class="token punctuation">,</span>
                <span class="token property">"offset"</span><span class="token operator">:</span> <span class="token number">16</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span>
                <span class="token property">"datatype"</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
                <span class="token property">"count"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"time"</span><span class="token punctuation">,</span>
                <span class="token property">"offset"</span><span class="token operator">:</span> <span class="token number">18</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"row_step"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"is_bigendian"</span><span class="token operator">:</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe "  固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳      详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">array/string</td>
<td style="text-align:left">存放点云数据的数组<br>或者是转成base64数据的字符串, 使用时需要先解码才能使用</td>
</tr>
<tr>
<td style="text-align:left">width</td>
<td style="text-align:left">int</td>
<td style="text-align:left">数组的宽度</td>
</tr>
<tr>
<td style="text-align:left">height</td>
<td style="text-align:left">int</td>
<td style="text-align:left">数组的行宽</td>
</tr>
<tr>
<td style="text-align:left">is_dense</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否存在非法数据点</td>
</tr>
<tr>
<td style="text-align:left">point_step</td>
<td style="text-align:left">int</td>
<td style="text-align:left">⼀个点的字节⻓度</td>
</tr>
<tr>
<td style="text-align:left">row_step</td>
<td style="text-align:left">int</td>
<td style="text-align:left">一行数据的字节步长</td>
</tr>
<tr>
<td style="text-align:left">fields</td>
<td style="text-align:left">array</td>
<td style="text-align:left">对每个点⾥⾯的包含的元素的描述</td>
</tr>
<tr>
<td style="text-align:left">datatype</td>
<td style="text-align:left">float</td>
<td style="text-align:left">元素的数据类型:<div>&nbsp;uint8 INT8=1, uint8 UINT8=2 ,</div><div>uint8 INT16=3, uint8 UINT16=4 ,</div><div>uint8 INT32=5, uint8 UINT32=6 ,</div><div>uint8 FLOAT32=7 ,uint8 FLOAT64=8<br><div><br></div></div></td>
</tr>
<tr>
<td style="text-align:left">count</td>
<td style="text-align:left">float</td>
<td style="text-align:left">元素具体数量</td>
</tr>
<tr>
<td style="text-align:left">name</td>
<td style="text-align:left">float</td>
<td style="text-align:left">元素名称</td>
</tr>
<tr>
<td style="text-align:left">offset</td>
<td style="text-align:left">float</td>
<td style="text-align:left">元素存放的字节数</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="激光雷达传感器2d点云数据">激光雷达传感器2D点云数据 </h4>
<ul>
<li>
<p><strong>注意事项:</strong><br>
前提条件：需要配备导航套件中的雷达传感器一起使用</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上搭载的激光雷达的3D点云数据 处理后的2D点云数据，<strong>只有开启导航后有效</strong> ,查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong> ,应答频率10hz（每秒10次）</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/scan"</span><span class="token punctuation">,</span>
    <span class="token property">"compression"</span><span class="token operator">:</span> <span class="token string">"cbor"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"sensor_msgs/LaserScan"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left"></td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题对应的类型</td>
<td style="text-align:left">否   (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
<tr>
<td style="text-align:left">compression</td>
<td style="text-align:left">string</td>
<td style="text-align:left">非必填,如果带有这条字段,发送端会对数据进行转成bytes传输，如果没有填写，则是默认的float数组数据</td>
<td style="text-align:left">否</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
根据请求数据是否携带<code>"compression": "cbor"</code>,作为区分方式。</p>
<ul>
<li>带有上述字段的应答形式为16进制的bytes,要想得到真正的数据，必须经过转码，将bytes 转换成 uint8 array</li>
<li>具体转码案例请参考  <strong><a href="#jump_8">使用案例</a></strong> 中的<strong>订阅2D点云数据</strong>部分代码</li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
        
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/scan"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"angle_min"</span><span class="token operator">:</span> <span class="token number">-3.1415927410125732</span><span class="token punctuation">,</span>
        <span class="token property">"angle_max"</span><span class="token operator">:</span> <span class="token number">3.1415927410125732</span><span class="token punctuation">,</span>
        <span class="token property">"range_min"</span><span class="token operator">:</span> <span class="token number">0.20000000298023224</span><span class="token punctuation">,</span>
        <span class="token property">"range_max"</span><span class="token operator">:</span> <span class="token number">100.0</span><span class="token punctuation">,</span>
        <span class="token property">"scan_time"</span><span class="token operator">:</span> <span class="token number">0.10000000149011612</span><span class="token punctuation">,</span>
        <span class="token property">"angle_increment"</span><span class="token operator">:</span> <span class="token number">0.009999999776482582</span><span class="token punctuation">,</span>
   
        <span class="token property">"ranges"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1680850381</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">861026764</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"laser_link"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">54</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"intensities"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"time_increment"</span><span class="token operator">:</span> <span class="token number">0.0</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>

<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " 固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳 &nbsp; 详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">angle_min</td>
<td style="text-align:left">array/string</td>
<td style="text-align:left">开始扫描的角度</td>
</tr>
<tr>
<td style="text-align:left">angle_max</td>
<td style="text-align:left">int</td>
<td style="text-align:left">结束扫描的角度</td>
</tr>
<tr>
<td style="text-align:left">range_min</td>
<td style="text-align:left">int</td>
<td style="text-align:left">测距的最小值</td>
</tr>
<tr>
<td style="text-align:left">range_max</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">测距的最大值</td>
</tr>
<tr>
<td style="text-align:left">scan_time</td>
<td style="text-align:left">int</td>
<td style="text-align:left">扫描的时间间隔</td>
</tr>
<tr>
<td style="text-align:left">angle_increment</td>
<td style="text-align:left">int</td>
<td style="text-align:left">每次扫描增加的角度</td>
</tr>
<tr>
<td style="text-align:left">ranges</td>
<td style="text-align:left">array</td>
<td style="text-align:left">存放点云数据的数组或者转成base64数据的字符串述</td>
</tr>
<tr>
<td style="text-align:left">intensities</td>
<td style="text-align:left">array</td>
<td style="text-align:left">与设备有关，强度数组长度360</td>
</tr>
<tr>
<td style="text-align:left">time_increment</td>
<td style="text-align:left">float</td>
<td style="text-align:left">测量的时间间隔</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="激光雷达传感器导航时位置">激光雷达传感器导航时位置 </h4>
<ul>
<li>
<p><strong>注意事项:</strong><br>
前提条件：需要配备导航套件中的雷达传感器一起使用</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上搭载的雷达传感器位置，<code>只有开启导航后有效</code>。查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong> ,应答频率10hz（每秒10次）</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/localizer_pose"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"geometry_msgs/PoseStamped"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/localizer_pose"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1681894209</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">947040319</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"/map"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">27624</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"pose"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">-1.8548997640609741</span><span class="token punctuation">,</span>
                <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">-1.9490784406661987</span><span class="token punctuation">,</span>
                <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">-0.29712432622909546</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"orientation"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0.010174116206043981</span><span class="token punctuation">,</span>
                <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0.0029751862931754166</span><span class="token punctuation">,</span>
                <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">-0.16941087211360253</span><span class="token punctuation">,</span>
                <span class="token property">"w"</span><span class="token operator">:</span> <span class="token number">0.9854885042635735</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳 &nbsp; 详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">pose</td>
<td style="text-align:left">object</td>
<td style="text-align:left">机器人位姿信息,详情参考下方pose表</td>
</tr>
</tbody>
</table>
<p>pose参数表</p>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">position</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点坐标信息</td>
</tr>
<tr>
<td style="text-align:left">position.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点方向四元数信息,以四元数形式表示自由空间中的方向。</td>
</tr>
<tr>
<td style="text-align:left">orientation.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.w</td>
<td style="text-align:left">float</td>
<td style="text-align:left">w轴的值</td>
</tr>
<tr>
<td style="text-align:left">covariance</td>
<td style="text-align:left">array</td>
<td style="text-align:left">协方差</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="相机rgb图像数据">相机RGB图像数据 </h4>
<ul>
<li>
<p><strong>注意事项:</strong><br>
前提条件：需要配备导航套件中的realsense相机传感器一起使用</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上搭载的realsense相机的rgb图像数据,应答频率30hz（每秒30次）,如果topic字段中的"/camera/" 无效，需要修改成/camera_01</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/camera_01/color/image_raw"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"sensor_msgs/Image"</span><span class="token punctuation">,</span>
    <span class="token property">"compression"</span><span class="token operator">:</span> <span class="token string">"cbor"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题对应的类型</td>
<td style="text-align:left">否 &nbsp; (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
<tr>
<td style="text-align:left">compression</td>
<td style="text-align:left">string</td>
<td style="text-align:left">非必填,如果带有这条字段,发送端会对数据进行转成bytes传输，如果没有填写，则是默认的float数组数据</td>
<td style="text-align:left">否</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
根据请求数据是否携带<code>"compression": "cbor"</code>,作为区分方式。</p>
</li>
<li>
<p>带有上述字段的应答形式为16进制的bytes,要想得到真正的数据，必须经过转码，将bytes 转换成 uint8 array</p>
</li>
<li>
<p>没有上述字段的应答形式为json + base64的形式，如下所示，要想得到真正的数据，必须经过base64解码得到bytes,再将其转换成uint8 array</p>
</li>
<li>
<p>具体转码案例请参考  <strong><a href="#jump_8">使用案例</a></strong> 中的<strong>订阅相机数据</strong>部分代码</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/camera_01/color/image_raw"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"encoding"</span><span class="token operator">:</span> <span class="token string">"rgb8"</span><span class="token punctuation">,</span>
        <span class="token property">"height"</span><span class="token operator">:</span> <span class="token number">480</span><span class="token punctuation">,</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1678269240</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">993803740</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"camera_color_optical_frame"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">49853</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"step"</span><span class="token operator">:</span> <span class="token number">1920</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token property">"width"</span><span class="token operator">:</span> <span class="token number">640</span><span class="token punctuation">,</span>
    <span class="token property">"is_bigendian"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span> 
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳 &nbsp; &nbsp;详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">encoding</td>
<td style="text-align:left">string</td>
<td style="text-align:left">图像的编码格式，包含RGB、YUV等常用格式，不涉及图像压缩编码</td>
</tr>
<tr>
<td style="text-align:left">height</td>
<td style="text-align:left">int</td>
<td style="text-align:left">图像的高度</td>
</tr>
<tr>
<td style="text-align:left">width</td>
<td style="text-align:left">int</td>
<td style="text-align:left">图像的宽度</td>
</tr>
<tr>
<td style="text-align:left">step</td>
<td style="text-align:left">int</td>
<td style="text-align:left">一行图像数据的字节数量，作为数据的步长参数</td>
</tr>
<tr>
<td style="text-align:left">is_bigendian</td>
<td style="text-align:left">int</td>
<td style="text-align:left">图像数据的大小端存储模式</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">array/string</td>
<td style="text-align:left">1.请求时未使用"compression"字段 ，那么得到的数据是存储图像数据的数组2.请求时使用必填"compression"字段得到base64数据,使用时需要将base64数据还原成data[height*step]</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="相机depth图像数据">相机depth图像数据 </h4>
<ul>
<li>
<p><strong>注意事项:</strong><br>
前提条件：需要配备导航套件中的realsense相机传感器一起使用</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上搭载的realsense相机的depth图像点云数据,如果topic字段中的"/camera/" 无效，需要修改成/camera_01</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/camera/depth/image_rect_raw/compressed"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"sensor_msgs/CompressedImage"</span><span class="token punctuation">,</span>
    <span class="token property">"compression"</span><span class="token operator">:</span> <span class="token string">"cbor"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必选</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题对应的类型</td>
<td style="text-align:left">否 &nbsp; (仅在使用ROS js标准库-roslib.js做二次开发时使用必填)</td>
</tr>
<tr>
<td style="text-align:left">compression</td>
<td style="text-align:left">string</td>
<td style="text-align:left">非必填,如果带有这条字段,发送端会对数据进行转成bytes传输，如果没有填写，则是默认的float数组数据</td>
<td style="text-align:left">否</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
根据请求数据是否携带<code>"compression": "cbor"</code>,作为区分方式。</p>
</li>
<li>
<p>带有上述字段的应答形式为16进制的bytes,要想得到真正的数据，必须经过转码，将bytes 转换成 uint8 array</p>
</li>
<li>
<p>没有上述字段的应答形式为json + base64的形式，如下所示，要想得到真正的数据，必须经过base64解码得到bytes,再将其转换成uint8 array</p>
</li>
<li>
<p>具体转码案例请参考  <strong><a href="#jump_8">使用案例</a></strong> 中的<strong>订阅相机数据</strong>部分代码</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/camera/depth/image_rect_raw/compressed"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1678270240</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">532729626</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"camera_depth_optical_frame"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">71951</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"format"</span><span class="token operator">:</span> <span class="token string">"16UC1; jpeg compressed "</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳 &nbsp; &nbsp;详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">format</td>
<td style="text-align:left">string</td>
<td style="text-align:left">图像的编码格</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">array/string</td>
<td style="text-align:left">1.请求时未使用"compression"字段 ，那么得到的数据是存储图像数据的数组2.请求时使用必填"compression"字段得到base64数据,使用时需要将base64数据还原成data[height*step]</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="相机其他话题数据">相机其他话题数据 </h4>
<ul>
<li>
<p><strong>注意事项:</strong><br>
前提条件：需要配备导航套件中的realsense相机或大白传感器一起使用</p>
</li>
<li>
<p><strong>接口说明:</strong><br>
获取机器人上搭载的realsense相机的其他的话题数据,这里不列举案例，只提供话题名称，不提供应答信息，如果需要了解话题及其消息数据对应的含义，<br>
可参考 <code>https://github.com/IntelRealSense/realsense-ros/tree/ros1-legacy</code></p>
<ul>
<li>相机话题列表</li>
</ul>
<pre data-role="codeBlock" data-info="" class="language-text"><code>/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/color/metadata
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth/parameter_updates
/camera/depth/image_rect_raw/compressed/parameter_descriptions
/camera/depth/image_rect_raw/compressed/parameter_updates
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/depth/image_rect_raw/theora/parameter_updates
/camera/depth/metadata
/camera/extrinsics/depth_to_color
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
</code></pre></li>
</ul>
<h4 id="日志信息">日志信息 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘上报的日志数据,应答频率未固定，只有触发日志时会上报具体消息。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/freego_log/log"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"freego_log/Log"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/freego_log/log"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1680848214</span><span class="token punctuation">,</span>
            <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">679842222</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"level"</span><span class="token operator">:</span> <span class="token number">2</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">stamp</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳    详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体的log消息</td>
</tr>
<tr>
<td style="text-align:left">level</td>
<td style="text-align:left">int</td>
<td style="text-align:left">日志等级， DEBUG=1,INFO=2,WARN=4,ERROR=8,FATAL=16</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="磁盘信息">磁盘信息 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘的磁盘空间，应答频率1hz（每秒1次）</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/disk_states"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/DiskStates"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/disk_states"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"disks"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">"disk_total_size"</span><span class="token operator">:</span> <span class="token string">"225"</span><span class="token punctuation">,</span>
            <span class="token property">"disk_free_size"</span><span class="token operator">:</span> <span class="token string">"211"</span><span class="token punctuation">,</span>
            <span class="token property">"disk_name"</span><span class="token operator">:</span> <span class="token string">"disk system"</span>
        <span class="token punctuation">}</span>    
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"subscribe":订阅</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">disks</td>
<td style="text-align:left">array</td>
<td style="text-align:left">磁盘列表</td>
</tr>
<tr>
<td style="text-align:left">disk_total_size</td>
<td style="text-align:left">string</td>
<td style="text-align:left">磁盘总大小</td>
</tr>
<tr>
<td style="text-align:left">disk_free_size</td>
<td style="text-align:left">string</td>
<td style="text-align:left">剩余空间</td>
</tr>
<tr>
<td style="text-align:left">disk_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">磁盘名称</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="机器人操作">机器人操作 </h3>
<h4 id="移动控制">移动控制 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
对机器人进行运动控制,客户端发送一次数据,服务端会接收一次数据，机器人会运动一次<br>
如果要持续运动,需要持续发送该数据,频率是10hz，10/s(秒)<br>
<strong>注意:</strong> 此接口的topic可以有两个值 "/run_management/virtual_joy","/cmd_vel"。两者区别是有效期限制。<br>
当topic = "/run_management/virtual_joy"时，无论机器人当前属于何种状态，全局有效。<br>
当topic = "/cmd_vel"时,<strong>有且只有处于导航状态时有效</strong>，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong>，</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/cmd_vel"</span><span class="token punctuation">,</span> <span class="token comment">//或 /run_management/virtual_joy</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"geometry_msgs/Twist"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span><span class="token punctuation">{</span>
        <span class="token property">"linear"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"angular"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必填</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"publish":订阅</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称类型</td>
<td style="text-align:left">否</td>
</tr>
<tr>
<td style="text-align:left">linear</td>
<td style="text-align:left">object</td>
<td style="text-align:left">线速度,（纵轴上的移动）</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">linear.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x&gt; 0 : 前进, x &lt; 0 :后退<div>速度: +/-1.5(米每秒m/s)<br></div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">linear.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">非ranger 系列车型填写0即可,除此之外表示横向移动</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">linear.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">填写0即可</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">angular</td>
<td style="text-align:left">object</td>
<td style="text-align:left">角速度,（横轴上的移动）</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">angular.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z &gt; 0:左转 , z &lt; 0 : 右转<div>速度:+/-1.5(弧度每秒rad/s)<br></div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">angular.x,angular.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">填写0即可</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
无<br>
<strong>注意：</strong> 查看机器人是否移动来验证验证请求是否成功</p>
</li>
</ul>
<h4 id="灯光控制">灯光控制 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
对机器人进行灯光控制,发送一次数据即可,ranger系列车型的msg中 只有 front_mode = 1/0 常开/关模式，无其他模式,需要升级车型软件版V0.1.2后使用</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/robot_light_ctl"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"robot_status_core/RobotLightCmd"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"front_mode"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"front_custom_value"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"rear_mode"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"rear_custom_value"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必填</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"publish":订阅</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称类型</td>
<td style="text-align:left">否</td>
</tr>
<tr>
<td style="text-align:left">front_mode</td>
<td style="text-align:left">int</td>
<td style="text-align:left">前灯控制模式<div>0 - 常关&nbsp;</div><div>1 - 常开&nbsp;</div><div>2 - 呼吸灯模式&nbsp;</div><div>3 - 客⼾⾃定义亮度<br></div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">front_custom_value</td>
<td style="text-align:left">int</td>
<td style="text-align:left">只有front_mode= 3时有效，范围(0~100)</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">rear_mode</td>
<td style="text-align:left">int</td>
<td style="text-align:left"><div>后灯控制模式<div>0 - 常关&nbsp;</div><div>1 - 常开&nbsp;</div><div>2 - 呼吸灯模式&nbsp;</div><div>3 - 客⼾⾃定义亮度</div></div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">rear_custom_value</td>
<td style="text-align:left">int</td>
<td style="text-align:left">只有rear_mode= 3时有效，范围(0~100)</td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
无,<br>
<strong>注意：</strong> 需要查看机器人本身车灯状态变化验证请求是否成功</p>
</li>
</ul>
<h4 id="心跳指令">心跳指令 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
心跳指令：websocket客户端可间隔5秒发1次，用于检测连接，否则视为与服务器连接断开,服务器将会断开当前连接的客户端。</p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"ping"</span><span class="token punctuation">,</span>
    <span class="token property">"id"</span><span class="token operator">:</span><span class="token string">"aa1b2c-dd"</span><span class="token punctuation">,</span>
    <span class="token property">"timeStamp"</span><span class="token operator">:</span> <span class="token number">1681465384099</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型"ping"</td>
</tr>
<tr>
<td style="text-align:left">timeStamp</td>
<td style="text-align:left">int</td>
<td style="text-align:left">客户端发送的时间戳，可用于计算通信延迟</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">客户端唯一标识符,英文+数字组成字符串,在每次启动ws client时生成。可用于与服务器重连</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"pong"</span><span class="token punctuation">,</span>
    <span class="token property">"timeStamp"</span><span class="token operator">:</span> <span class="token number">1681465384099</span><span class="token punctuation">,</span>
    <span class="token property">"serverTime"</span><span class="token operator">:</span> <span class="token number">1681465384099</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复类型,固定是"pong"</td>
</tr>
<tr>
<td style="text-align:left">timeStamp</td>
<td style="text-align:left">int</td>
<td style="text-align:left">客户端发送的时间戳，可用于计算通信延迟</td>
</tr>
<tr>
<td style="text-align:left">serverTime</td>
<td style="text-align:left">int</td>
<td style="text-align:left">服务端收到当前ping请求的时间</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="驻车使能">驻车使能 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
电机使能接口，实现控制机器人电机抱闸开关,设置驻车模式，<strong>仅Ranger mini 车型有效</strong></p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/set_park_mode"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"std_srvs/SetBool"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"data"</span><span class="token operator">:</span><span class="token boolean">true</span> 
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true:开启驻车，false:结束驻车</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/set_park_mode"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体消息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="控制柜门操作">控制柜门操作 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
控制柜门使能接口，实现控制柜门开启以及状态读取,<strong>仅支持有控制柜的移动机器人</strong></p>
</li>
<li>
<p><strong>请求数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/lock_server"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"control_lock/Lock"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"mode"</span><span class="token operator">:</span><span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"mode_num"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"lock_num"</span><span class="token operator">:</span><span class="token number">1</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">发送控制指令的模式"open"or"read"</td>
</tr>
<tr>
<td style="text-align:left">mode_num</td>
<td style="text-align:left">int</td>
<td style="text-align:left">发送控制指令模式的编号 1:open, 0:read</td>
</tr>
<tr>
<td style="text-align:left">lock_num</td>
<td style="text-align:left">int</td>
<td style="text-align:left">柜门门锁编号1～6</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"state"</span><span class="token operator">:</span><span class="token string">""</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/lock_server"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre></li>
</ul>
<h3 id="获取导航相关状态">获取导航相关状态 </h3>
<h4 id="导航系统状态">导航系统状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘当前导航系统状态，<br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong>，应答频率不固定，仅当状态更新时应答数据。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/global_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"support_ros/GlobalStatus"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/global_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"map_name"</span><span class="token operator">:</span> <span class="token string">"1205"</span><span class="token punctuation">,</span>
        <span class="token property">"status"</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>
        <span class="token property">"text"</span><span class="token operator">:</span> <span class="token string">""</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">map_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前导航所用的地图名称</td>
</tr>
<tr>
<td style="text-align:left">text</td>
<td style="text-align:left">string</td>
<td style="text-align:left">提示消息</td>
</tr>
<tr>
<td style="text-align:left">status</td>
<td style="text-align:left">int</td>
<td style="text-align:left">导航系统的状态，可能存在的值<div><div>0 : 等待新任务</div><div>1 : 正在执行任务</div><div>2 : 取消任务</div><div>3 : 任务完成</div><div>4 : 任务中断</div><div>5 : 任务暂停</div><div>6 : 定位丢失</div><div>7 : 异常状态,一般最后一个点无法到达会反馈此状态</div><div>8 : 任务异常暂停，一般中间某个点无法到达会反馈此状态</div><div>9 : 正在充电</div><div>10 返回充电桩</div><div>11 : 正在出桩</div><div>12 : 返回起点</div><div>13 : 未出桩</div><div>14 : 等待充电信号</div> </div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="当前进行中任务状态">当前进行中任务状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘当前进行中的任务作业状态<br>
<strong>注意</strong>，只有处于导航状态，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong>,并且已经发布过实时任务或者列表任务的情况下有效，应答频率不固定，仅当状态更新时应答一次数据。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/task_status"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"support_ros/TaskStatus"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/task_status"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"task_type"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"total_looptimes"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"loop_index"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"task_index"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"countdown"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"isGoalReach"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> 
        <span class="token property">"task_name"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"total_tasks"</span><span class="token operator">:</span> <span class="token number">1</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">task_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前导航所用的任务名称</td>
</tr>
<tr>
<td style="text-align:left">task_type</td>
<td style="text-align:left">int</td>
<td style="text-align:left">任务类型,<div>MUTIPATH-路径导航任务</div><div>MUTIPOINT-多点导航任务</div></td>
</tr>
<tr>
<td style="text-align:left">total_looptimes</td>
<td style="text-align:left">int</td>
<td style="text-align:left">任务总循环次数</td>
</tr>
<tr>
<td style="text-align:left">loop_index</td>
<td style="text-align:left">int</td>
<td style="text-align:left">当前循环到第几次任务</td>
</tr>
<tr>
<td style="text-align:left">task_index</td>
<td style="text-align:left">int</td>
<td style="text-align:left">当前任务执行到第几个目标</td>
</tr>
<tr>
<td style="text-align:left">countdown</td>
<td style="text-align:left">int</td>
<td style="text-align:left">到达目标点之后的倒计时/任务完成之后的倒计时确认</td>
</tr>
<tr>
<td style="text-align:left">isGoalReach</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否到达当前目标点</td>
</tr>
<tr>
<td style="text-align:left">total_tasks</td>
<td style="text-align:left">int</td>
<td style="text-align:left">任务中的总目标数</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="当前进行中任务进度">当前进行中任务进度 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘当前进行中的任务作业完成度<br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong> ,仅当开始任务之后才会更新应答数据,10hz（每秒10次）。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/task_progress"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"std_msgs/Float64"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/task_progress"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token number">0.0</span> 
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">float</td>
<td style="text-align:left">0~1，当前任务执行进度</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="导航定位状态">导航定位状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<a id="jump_7" href=""></a><br>
获取机器人底盘当前进行中的导航定位状态<br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong>，应答频率不固定，仅当状态更新时应答一次数据。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/localization_lost"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"std_msgs/Bool"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/localization_lost"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true-定位丢失,false-定位准确</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="机器人位置">机器人位置 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
topic = /odom 可获取机器人导航时相对于地图原点(建图的起点，可在获取地图信息接口中得到数据)的位置，应答频率50hz（每秒50次）<br>
<em>注意:</em></p>
<ul>
<li>如果使用机器人位置的数据作为 <strong><a href="#jump_16">初始化位置点</a></strong> 接口数据，可以将"pose" 填写到 "初始化位置点"的"pose"使用。</li>
<li>如果使用机器人位置的数据作为  <strong><a href="#jump_2">设置某个地图某个任务信息</a></strong>" 和 <strong><a href="#jump_15">设置地图实时任务信息</a></strong> 中的position数据，需要将"orientation" 转成角度使用，转换函数请参考python demo 中的 <strong><a href="#jump_8">quaternion_to_euler</a></strong></li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/odom_raw"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"nav_msgs/Odometry"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/odom_raw"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1681805920</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">64378373</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"map"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">1098806</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"child_frame_id"</span><span class="token operator">:</span><span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"pose"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"pose"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">"orientation"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"w"</span><span class="token operator">:</span> <span class="token number">1</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"covariance"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"twist"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"twist"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"linear"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">"angular"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"covariance"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳   详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">child_frame_id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">子坐标系</td>
</tr>
<tr>
<td style="text-align:left">pose</td>
<td style="text-align:left">object</td>
<td style="text-align:left">机器人位姿信息,详情参考下方pose表</td>
</tr>
<tr>
<td style="text-align:left">twist</td>
<td style="text-align:left">object</td>
<td style="text-align:left">机器人速度信息,可忽略</td>
</tr>
</tbody>
</table>
<p>pose参数表</p>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">position</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点坐标信息</td>
</tr>
<tr>
<td style="text-align:left">position.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点方向四元数信息,<div>以四元数形式表示自由空间中的方向。<br></div></td>
</tr>
<tr>
<td style="text-align:left">orientation.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.w</td>
<td style="text-align:left">float</td>
<td style="text-align:left">w轴的值</td>
</tr>
<tr>
<td style="text-align:left">covariance</td>
<td style="text-align:left">array</td>
<td style="text-align:left">协方差</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取导航规划路径">获取导航规划路径 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机器人底盘当前进行中的任务作业规划路径<br>
<strong>注意</strong>，只有处于导航且设置任务时状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong>,仅当开始任务之后更新应答数据，10hz（每秒10次）</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/visual_path"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"nav_msgs/Path"</span> 
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/visual_path"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1681805920</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">64378373</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"map"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">1098806</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"poses"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                        <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1681115920</span><span class="token punctuation">,</span>
                        <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">64378373</span>
                    <span class="token punctuation">}</span><span class="token punctuation">,</span>
                    <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"map"</span><span class="token punctuation">,</span>
                    <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">1098806</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">"pose"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                        <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span>
                    <span class="token punctuation">}</span><span class="token punctuation">,</span>
                    <span class="token property">"orientation"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                        <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token property">"w"</span><span class="token operator">:</span> <span class="token number">1</span>
                    <span class="token punctuation">}</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复操作类型"subscribe",固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳        详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">poses</td>
<td style="text-align:left">object</td>
<td style="text-align:left">路径点数组, pose信息列表,单个pose详情参考下方pose表</td>
</tr>
</tbody>
</table>
<p>pose参数表</p>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">position</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点坐标信息</td>
</tr>
<tr>
<td style="text-align:left">position.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点方向四元数信息,<div>以四元数形式表示自由空间中的方向。<br></div></td>
</tr>
<tr>
<td style="text-align:left">orientation.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.w</td>
<td style="text-align:left">float</td>
<td style="text-align:left">w轴的值</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="建图导航功能相关操作">建图导航功能相关操作 </h3>
<h4 id="注意事项-2">注意事项 </h4>
<ul>
<li>
<p>建图与导航使用同一套接口,各有两种形式启动，根据参数对象中的"id_type"字段启动</p>
<ul>
<li>/input/op接口, call_service形式</li>
</ul>
</li>
<li>
<p>建图两种形式</p>
<ul>
<li>1.首先需要录制bag，然后使用bag构建3d地图，最后使用生成的3d地图构建2d地图</li>
<li>2.录制bag与构建3d地图同时进行,最后生成的3d地图构建2d地图</li>
</ul>
</li>
<li>
<p>导航两种形式</p>
<ul>
<li>1.启动标准导航，只能通过给定导航点进行导航</li>
<li>2.启动循线导航，保留导航点导航，同时加入自定义路径导航,按照路径进行导航。</li>
</ul>
</li>
<li>
<p>http 版本</p>
<ul>
<li><strong><a href="#jump_10">录包建图导航</a></strong></li>
</ul>
</li>
<li>
<p>/input/op接口介绍</p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/input/op"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/input"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"file_name"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"op_type"</span><span class="token operator">:</span><span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"id_type"</span><span class="token operator">:</span><span class="token string">""</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p>/input/op接口参数表<a id="jump_6" href=""></a></p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
<th style="text-align:left">是否必填</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务 call_service</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型对应的参数</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">file_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">文件名可用于保存录包名称，构建地图，启动导航地图，三者需保持一致，进行取消操作时，file_name可以为空。</td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">op_type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型,可能值<div><div>start: 开启</div><div>stop: 结束某个id_type操作，并保存</div><div>cancel: 取消某个idType操作，不会保存</div><div>pause: 暂停</div><div>continue: 继续</div><div><br></div></div></td>
<td style="text-align:left">是</td>
</tr>
<tr>
<td style="text-align:left">id_type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">指令类型，可能值<div><div>record_data: 启动录包，保持file</div><div>map_3d: 启动3D建图</div><div>map_2d: 启动2D建图</div><div>navigation：启动标准导航，只能通过给定导航点进行导航</div><div>follow_line: 启动循线导航，可以通过给导航点，也可以给定路径，按照路径进行导航</div><div>set_pcd: 开启导航后，若觉得开启的地图不正确，可以通过该字段切换3D地图，配合set_map使用</div><div>set_map: 开启导航后，若觉得开启的地图不正确，可以通过该字段切换2D地图，配合set_pcd使用</div><div>change_map: 开启导航后，若觉得开启的地图不正确，可以通过该字段同时切换2D地图，3D地图</div><div>record_and_map:启动录包并同时启动3D雷达建图</div><div>way_creator: 启动路径绘制功能</div><div>record_point:启动路径点录制功能，</div><div>record_path:启动路径录制功能，</div><div>close_all:关闭所有在运行的建图和导航节点</div></div></td>
<td style="text-align:left">是</td>
</tr>
</tbody>
</table>
<p>响应参数列表</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体消息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="启动建图">启动建图 </h4>
<ul>
<li>
<p><strong>接口说明:</strong></p>
<ul>
<li>启动或者关闭录包建图,录制bag与构建3d地图同时进行,</li>
<li>再使用生成的3d地图构建2d地图( "id_type":"map_2d")。</li>
<li>也可以将<code>id_type</code>按这样的顺序来进行建图,<code>record_data</code>-&gt;<code>map_3d</code>-&gt;<code>map_2d</code></li>
<li>更多的请求参数可以参考本章节的注意事项参数列表</li>
<li>详情参考 <strong><a href="#jump_6">接口参数表</a></strong></li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/input/op"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/input"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"file_name"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"op_type"</span><span class="token operator">:</span><span class="token string">"start"</span><span class="token punctuation">,</span>
        <span class="token property">"id_type"</span><span class="token operator">:</span><span class="token string">"record_and_map"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/input/op"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre></li>
</ul>
<h4 id="建图进度">建图进度 </h4>
<ul>
<li>
<p><strong>接口说明:</strong></p>
<ul>
<li>构建3D地图与2D地图的百分比进度值</li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>   
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/map_progress"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"std_msgs/Int32"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/map_progress"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token number">50</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
data = 建图百分比进度值
</code></pre></li>
</ul>
<h4 id="启动关闭导航">启动/关闭导航 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
启动或者关闭巡线导航</p>
</li>
<li>
<p><strong>请求数据</strong><br>
详情参考 <strong><a href="#jump_6">接口参数表</a></strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/input/op"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/input"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"file_name"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"op_type"</span><span class="token operator">:</span><span class="token string">"start"</span><span class="token punctuation">,</span>
        <span class="token property">"id_type"</span><span class="token operator">:</span><span class="token string">"follow_line"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/input/op"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre></li>
</ul>
<p><a id="jump_16" href=""></a></p>
<h4 id="初始化位置点">初始化位置点 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
开启导航后,机器人定位不准确时，可通过设置初始化位置点，使机器人进行自定位功能，直到定位准确。<br>
<strong>注意</strong></p>
<ul>
<li>只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong></li>
<li>填写"position"时需要填写地图坐标，如何获取地图坐标，请参考 <strong><a href="#jump_11">坐标转换</a></strong></li>
<li>"orientation":位置点方向四元数,可如示例数据填写。</li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/initialpose"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"geometry_msgs/PoseWithCovarianceStamped"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span><span class="token punctuation">{</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1681805920</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">64378373</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">"map"</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">1098806</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"pose"</span><span class="token operator">:</span><span class="token punctuation">{</span>
            <span class="token property">"pose"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"position"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">"orientation"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">"w"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                    <span class="token property">"z"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"covariance"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                    <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作类型,固定是"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳     详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">pose</td>
<td style="text-align:left">object</td>
<td style="text-align:left">机器人位姿信息,详情参考下方pose表</td>
</tr>
</tbody>
</table>
<p>pose参数表</p>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">position</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点坐标信息</td>
</tr>
<tr>
<td style="text-align:left">position.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">position.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation</td>
<td style="text-align:left">object</td>
<td style="text-align:left">位置点方向四元数信息,<div>以四元数形式表示自由空间中的方向。<br></div></td>
</tr>
<tr>
<td style="text-align:left">orientation.x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">x轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">y轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.z</td>
<td style="text-align:left">float</td>
<td style="text-align:left">z轴的值</td>
</tr>
<tr>
<td style="text-align:left">orientation.w</td>
<td style="text-align:left">float</td>
<td style="text-align:left">w轴的值</td>
</tr>
<tr>
<td style="text-align:left">covariance</td>
<td style="text-align:left">array</td>
<td style="text-align:left">协方差</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
无<br>
<strong>注意</strong> 但需要查看导航定位状态是否定位准确，定位丢失需要重新初始化,<strong><a href="#jump_7">定位状态接口</a></strong></p>
</li>
</ul>
<h4 id="取消当前导航任务">取消当前导航任务 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
开启导航后,并且当前已经发布过实时任务或者列表任务，或者多目标点导航，多条路径导航的数据之后，再发送该指令，会取消本次作业。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/run_management/navi_task/cancel"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"actionlib_msgs/GoalID"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span><span class="token punctuation">{</span>
        <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">0</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">""</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">发布数据，固定"publish"</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">话题类型</td>
</tr>
<tr>
<td style="text-align:left">msg</td>
<td style="text-align:left">object</td>
<td style="text-align:left">话题类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">stamp</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳，可以为空  详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">secs</td>
<td style="text-align:left">int</td>
<td style="text-align:left">0</td>
</tr>
<tr>
<td style="text-align:left">nsecs</td>
<td style="text-align:left">int</td>
<td style="text-align:left">0</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">空字符串</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong><br>
无，<br>
<strong>注意:</strong> 查看当前任务状态，验证请求数据是否成功</p>
</li>
</ul>
<h4 id="暂停恢复当前导航任务">暂停/恢复当前导航任务 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
开启导航后,并且当前已经发布过实时任务或者列表任务，或者多目标点导航，多条路径导航的数据之后,机器人遇到突发情况，无法到达当前导航目标点时，发送该指令，会使机器人暂停当前作业，直到恢复作业，或者结束导航。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/pause"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"actionlib_msgs/GoalID"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span><span class="token punctuation">{</span>     
        <span class="token property">"pause"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
        <span class="token property">"reason"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">pause</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true:暂停 ,false:恢复</td>
</tr>
<tr>
<td style="text-align:left">reason</td>
<td style="text-align:left">int</td>
<td style="text-align:left">暂停原因可填写0</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"call_service:/run_management/pause"</span><span class="token punctuation">,</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"set navigation pause successfully"</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/pause"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体消息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="发送移动到下一个目标指令">发送移动到下一个目标指令 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
开启导航后,并且当前已经发布过实时任务或者列表任务，或者多目标点导航，多条路径导航的数据之后,机器人遇到突发情况，无法到达当前导航目标点时，发送该指令，会使机器人跳过当前导航目标点，前往下一个目标点。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/next_goal"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"std_srvs/SetBool"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span><span class="token punctuation">{</span>     
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true:前往下一个点,<div>false:取消前往下一个</div></td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"call_service:/run_management/next_goal"</span><span class="token punctuation">,</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"Move to the next target point"</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/next_goal"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体消息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置导航参数">设置导航参数 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
开启导航后,可以分别设置路径导航和多点导航的避障模式，</p>
<ul>
<li>避障:遇到障碍物会躲避，绕开运动</li>
<li>停障:遇到障碍物会停止运动</li>
<li>停障时间:设置停障多长时间之后绕开障碍物，有且仅有设置了停障模式之后才有作用</li>
<li>设置速度参数，包括速度最大值，加速度最大值.</li>
<li>设置时效性，包括临时有效和永久有效</li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/set_navi_params"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"tools_msgs/SetNavisParams"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token property">"data"</span><span class="token operator">:</span> <span class="token string">""</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"params_type"</span><span class="token operator">:</span> <span class="token number">1</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">array</td>
<td style="text-align:left">导航参数数组</td>
</tr>
<tr>
<td style="text-align:left">name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数: <div>point_mode-多点导航参数，值true:停障，false:避障;<br></div> <div>line_mode-多路径导航参数，值true:停障，false:避障;<br></div> <div>navis_ctrl_max_vel_x-设置最大速度值;<br></div> <div>navis_ctrl_max_acc_x-设置加速度最大值;<br></div> <div>follow_line_timeout-置停障多长时间之后绕开障碍物，有且仅有设置了停障模式有效,单位秒数;<br></div> <div>注意:以上参数可以进行选填到data 数组中,可以填写一个或多个参数对象<br></div></td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数值</td>
</tr>
<tr>
<td style="text-align:left">params_type</td>
<td style="text-align:left">int</td>
<td style="text-align:left">时效性 0: 永久有效,1:临时有效</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code> <span class="token punctuation">{</span>
     <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
         <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span>
     <span class="token punctuation">}</span><span class="token punctuation">,</span>
     <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
     <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/set_navi_params"</span><span class="token punctuation">,</span>
     <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
 <span class="token punctuation">}</span> 
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置避障模式">设置避障模式 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
开启导航后,可以动态调节导航作业时的避障模式，可分为避障与停障两种模式。</p>
<ul>
<li>避障:遇到障碍物会躲避，绕开运动</li>
<li>停障:遇到障碍物会停止运动</li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/switch_obstacle_avoid_model"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"std_srvs/SetBool"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span><span class="token punctuation">{</span>     
        <span class="token property">"data"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true:避障 ,false:停障</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code> <span class="token punctuation">{</span>
     <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
         <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"avoid obstacles"</span><span class="token punctuation">,</span>
         <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
     <span class="token punctuation">}</span><span class="token punctuation">,</span>
     <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
     <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/run_management/switch_obstacle_avoid_model"</span><span class="token punctuation">,</span>
     <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
 <span class="token punctuation">}</span>   
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体消息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="自主充电接口">自主充电接口 </h3>
<p>需要搭配我司生产自主充电套件一起使用，若无此套件，可忽略本单元自主充电相关接口</p>
<h4 id="设置充电点">设置充电点 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
需要在已开启导航，处于导航状态下，开启此项功能，会在记录机器人当前位置，并且将该位置为充电点点位，无需关心应答数据。<br>
每张地图只会有且只有一个充电点，每次设置都会刷新充电点。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/set_charge_point"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"std_srvs/Empty"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数 为空字典即可{}</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/set_charge_point"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="获取充电点">获取充电点 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
获取充电点坐标信息，该坐标是地图坐标，如需转换坐标，请参考 <strong><a href="#jump_11">坐标转换</a></strong>。<br>
本接口同时存在topic话题版本，通过订阅话题的形式可以获取充电点信息，话题名称:"/find_charger/get_charge_point"<br>
主要响应数据与服务形式的响应数据中的"values"字段数据相同，在此不做过多描述。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/get_charge_point"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/getChargePoint"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"get_charge_point"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
        <span class="token property">"charge_point"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">1.3843873739242554</span><span class="token punctuation">,</span>
            <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">-6.903390407562256</span><span class="token punctuation">,</span>
            <span class="token property">"theta"</span><span class="token operator">:</span> <span class="token number">1.7618789011855123</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/get_charge_point"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">get_charge_point</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否获取到充电点</td>
</tr>
<tr>
<td style="text-align:left">charge_point</td>
<td style="text-align:left">object</td>
<td style="text-align:left">充电点位信息<br></td>
</tr>
<tr>
<td style="text-align:left">x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">充电点x坐标</td>
</tr>
<tr>
<td style="text-align:left">y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">充电点x坐标</td>
</tr>
<tr>
<td style="text-align:left">theta</td>
<td style="text-align:left">float</td>
<td style="text-align:left">充电点角度</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="充电模块开关">充电模块开关 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
<code>前提条件</code>:处于导航状态下，并且需要先设置好充电点点位，机器人才能根据充电点位进行自主充电。<br>
开启此项功能，无论是否设置充电阈值，都会开启自主充电功能，前往设置好的充电点,与之相反则会关闭,取消自主充电功能,返回原点。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/set_charge"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"std_srvs/SetBool"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"data"</span><span class="token operator">:</span><span class="token boolean">true</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">data</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true:开启充电命令，如果此时电量大于最大充电阈值会失效;false:取消充电命令，如果此时电量小于最小充电阈值会失效</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"set set_charge to true success"</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/set_charge"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体消息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left"><div>该操作是否执行成功<br></div>true:成功<div>false:失败</div></td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置充电阈值">设置充电阈值 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong>，只有处于导航状态有效，查看是否开启导航请参考接口 <strong><a href="#jump_9">设备当前状态</a></strong><br>
设置充电的最小和最大阈值，当电量小于等于最小充电阈值时机器人会<strong>主动触发</strong>充电，当大于等于最大充电阈值时取消充电。无论设置的阈值是否合理，最终会返回最终阈值和相关信息，目前以下3种情况会设置失败：</p>
<ul>
<li>最小充电阈值小于10</li>
<li>最大充电阈值大于100</li>
<li>最大充电阈值小于等于最小充电阈值</li>
</ul>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/set_charge_level"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span><span class="token string">"tools_msgs/setChargeLevel"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"min_charge_level"</span><span class="token operator">:</span><span class="token number">10</span><span class="token punctuation">,</span>
        <span class="token property">"max_charge_level"</span><span class="token operator">:</span><span class="token number">20</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">min_charge_level</td>
<td style="text-align:left">int</td>
<td style="text-align:left">最小充电阈值</td>
</tr>
<tr>
<td style="text-align:left">max_charge_level</td>
<td style="text-align:left">int</td>
<td style="text-align:left">最大充电阈值</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"success."</span><span class="token punctuation">,</span>
        <span class="token property">"min_charge_level"</span><span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>
        <span class="token property">"max_charge_level"</span><span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/find_charger/set_charge_level"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型回复具体信息</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">是否开启或者取消自主回充 请求是否成功</td>
</tr>
<tr>
<td style="text-align:left">min_charge_level</td>
<td style="text-align:left">int</td>
<td style="text-align:left">最小充电阈值</td>
</tr>
<tr>
<td style="text-align:left">max_charge_level</td>
<td style="text-align:left">int</td>
<td style="text-align:left">最大充电阈值</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="充电桩信息">充电桩信息 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
<strong>注意</strong> 只有是无线充电桩，并且机器人处于自动回充状态时有效。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span><span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/charge_hz/charge_info"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"charge_msgs/ChargeInfo"</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>

    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/charge_hz/charge_info"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1696919345</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">36261310</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">93521</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"fault_code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"work_status"</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
        <span class="token property">"charge_current"</span><span class="token operator">:</span> <span class="token number">10.89</span><span class="token punctuation">,</span>
        <span class="token property">"charge_voltage"</span><span class="token operator">:</span> <span class="token number">54.9</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">object</td>
<td style="text-align:left">时间戳 &nbsp;详情可参考 <a href="#jump_4">时间戳</a></td>
</tr>
<tr>
<td style="text-align:left">work_status</td>
<td style="text-align:left">int</td>
<td style="text-align:left">充电桩工作状态 0:待机 1:启动中 2:恒流输出&nbsp;3:恒压输出</td>
</tr>
<tr>
<td style="text-align:left">fault_code</td>
<td style="text-align:left">int</td>
<td style="text-align:left">充电桩停止码</td>
</tr>
<tr>
<td style="text-align:left">charge_current</td>
<td style="text-align:left">float</td>
<td style="text-align:left">充电桩电流（A）</td>
</tr>
<tr>
<td style="text-align:left">charge_voltage</td>
<td style="text-align:left">float</td>
<td style="text-align:left">充电桩电压（V）</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h3 id="定时任务-设备相关接口">定时任务-设备相关接口 </h3>
<h4 id="验证新增设备接口">验证新增设备接口 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
添加机械臂、升降杆、RGBD相机等设备时的验证接口,判断是否支持该类型设备，检测设备是否连接正常。<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/verify_devices_server"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"verify_devices/VerifyDevice"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"config"</span><span class="token operator">:</span><span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"id"</span><span class="token operator">:</span><span class="token string">""</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">config</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备所需的配置参数，<div>机械臂设备config=ip,例如"192.168.1.2";</div><div>升降杆设备config=驱动端口号,例如"1"; </div><div>相机设备type=相机序列码,例如"020522071209" </div></td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">格式:type_config,<div>机械臂设备type=arm,例如arm_192/168/1/2;</div><div>升降杆设备type=lifter,例如lifter_1;</div><div>相机设备type=camera例如camera_020522071209</div></td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"机械臂验证通过!"</span><span class="token punctuation">,</span>
        <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">10301</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/verify_devices_server"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">string</td>
<td style="text-align:left">验证设备是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答码,和message内容对应</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体应答消息</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="定时任务导航状态">定时任务导航状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取定时任务导航状态,同时可监听临时任务/列表任务的状态，包括定位信息。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"agx_smach/SmachStatus"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/agx_smach_state"</span>
    
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/agx_smach_state"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"btName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"locationLost"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
        <span class="token property">"rotation"</span><span class="token operator">:</span> <span class="token number">136.87576293945312</span><span class="token punctuation">,</span>
        <span class="token property">"btTaskList"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">"222"</span><span class="token punctuation">,</span>
        <span class="token property">"x"</span><span class="token operator">:</span> <span class="token number">0.510503888130188</span><span class="token punctuation">,</span>
        <span class="token property">"y"</span><span class="token operator">:</span> <span class="token number">-0.5863337516784668</span><span class="token punctuation">,</span>
        <span class="token property">"smachStatus"</span><span class="token operator">:</span> <span class="token number">12</span><span class="token punctuation">,</span>
        <span class="token property">"taskName"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"percentage"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">btName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前正在运行的任务名称</td>
</tr>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前导航所使用的地图</td>
</tr>
<tr>
<td style="text-align:left">taskName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前正在运行的任务名称</td>
</tr>
<tr>
<td style="text-align:left">btTaskList</td>
<td style="text-align:left">string array</td>
<td style="text-align:left">当前定时任务中包含的列表任务</td>
</tr>
<tr>
<td style="text-align:left">smachStatus</td>
<td style="text-align:left">int</td>
<td style="text-align:left">反馈smach的状态及车辆的状态</td>
</tr>
<tr>
<td style="text-align:left">percentage</td>
<td style="text-align:left">int</td>
<td style="text-align:left">当前定时任务运行进度百分比</td>
</tr>
<tr>
<td style="text-align:left">locationLost</td>
<td style="text-align:left">int</td>
<td style="text-align:left">定位状态是否正常</td>
</tr>
<tr>
<td style="text-align:left">x</td>
<td style="text-align:left">float</td>
<td style="text-align:left">当前车辆位置x坐标</td>
</tr>
<tr>
<td style="text-align:left">y</td>
<td style="text-align:left">float</td>
<td style="text-align:left">当前车辆位置y坐标</td>
</tr>
<tr>
<td style="text-align:left">rotation</td>
<td style="text-align:left">float</td>
<td style="text-align:left">当前车辆位置角度</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="定时任务队列状态">定时任务队列状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取定时任务队列状态, 等待执行的任务时间</p>
<p><strong>注意</strong> 本接口所有车型通用</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"agx_smach/SmachTaskList"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/agx_smach_task"</span>
    
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/agx_smach_task"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"taskList"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
                <span class="token property">"nextRunDate"</span><span class="token operator">:</span> <span class="token string">"2024-02-21"</span><span class="token punctuation">,</span>
                <span class="token property">"btTaskList"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                    <span class="token string">"xe"</span>
                <span class="token punctuation">]</span><span class="token punctuation">,</span>
                <span class="token property">"mapName"</span><span class="token operator">:</span> <span class="token string">"222"</span><span class="token punctuation">,</span>
                <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token string">"separate"</span><span class="token punctuation">,</span>
                <span class="token property">"nextRunTime"</span><span class="token operator">:</span> <span class="token string">"18:33"</span><span class="token punctuation">,</span>
                <span class="token property">"taskName"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"7214504f-e91d-4b03-b514-058c1ff552db"</span><span class="token punctuation">,</span>
                <span class="token property">"remainTime"</span><span class="token operator">:</span> <span class="token string">"5"</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">taskList</td>
<td style="text-align:left">array</td>
<td style="text-align:left">定时任务列表</td>
</tr>
<tr>
<td style="text-align:left">mapName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">地图名称</td>
</tr>
<tr>
<td style="text-align:left">taskName</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务名称</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务模式</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">任务id</td>
</tr>
<tr>
<td style="text-align:left">nextRunDate</td>
<td style="text-align:left">string</td>
<td style="text-align:left">下次任务日期</td>
</tr>
<tr>
<td style="text-align:left">nextRunTime</td>
<td style="text-align:left">string</td>
<td style="text-align:left">下次任务时间</td>
</tr>
<tr>
<td style="text-align:left">remainTime</td>
<td style="text-align:left">string</td>
<td style="text-align:left">剩余时间秒数</td>
</tr>
<tr>
<td style="text-align:left">btTaskList</td>
<td style="text-align:left">string array</td>
<td style="text-align:left">子任务列表</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="升降杆控制">升降杆控制 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
添加机械臂、升降杆、RGBD相机等设备时的验证接口,判断是否支持该类型设备，检测设备是否连接正常。<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"LiftingMotorService"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"bt_task_msgs/LiftInterfaceSrv"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token number">-4</span><span class="token punctuation">,</span>
        <span class="token property">"val"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"lifter_1"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">val</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数值</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">控制模式:<div>mode=0为位置控制模式，val值表示要运动的升降柱高度值,范围[0,400];</div><div>mode=-2为控制电机急停; </div><div>-4为控制电机恒定速度运动，其中，速度为正表示升降柱向上，速度为负表示升降柱向下,val=[-1000,1000],正常速度值给500即可; <div>mode=-10开始订阅指定id的topic，并且发布该id的话题; </div> <div> mode=-11取消订阅指定id的topic，不再发布该id的话题;</div>  <div>mode=-5 设定电机最大速度，可以用来设定位置模式下升降柱的速度</div></div></td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">设备ID</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"设置成功"</span><span class="token punctuation">,</span>
        <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">10301</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/LiftingMotorService"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作升降杆设备是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答码,和message内容对应</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体应答消息</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="升降杆状态">升降杆状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取定时任务导航状态,同时可监听临时任务/列表任务的状态，包括定位信息。<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"bt_task_msgs/LiftMotorMsg"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/LiftMotorStatePub"</span>
   
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"upLimit"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"targetHeight"</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
    <span class="token property">"ctrlMode"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"overflowI"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"fpsError"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"externalCtrlMode"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"reachTargetPos"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"overflowV"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"posBiasOver"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"motorSpeed"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"runState"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"targetPos"</span><span class="token operator">:</span> <span class="token number">3484</span><span class="token punctuation">,</span>
    <span class="token property">"downLimit"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"overLoad"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"encodeErr"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"locationComplete"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token property">"backPos"</span><span class="token operator">:</span> <span class="token number">3483</span><span class="token punctuation">,</span>
    <span class="token property">"stateBit"</span><span class="token operator">:</span> <span class="token number">129</span><span class="token punctuation">,</span>
    <span class="token property">"backVol"</span><span class="token operator">:</span> <span class="token number">46</span><span class="token punctuation">,</span>
    <span class="token property">"backHeight"</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
    <span class="token property">"backCurrent"</span><span class="token operator">:</span> <span class="token number">0.03</span><span class="token punctuation">,</span>
    <span class="token property">"underVol"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token property">"backSpeed"</span><span class="token operator">:</span> <span class="token number">0</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">targetHeight</td>
<td style="text-align:left">int</td>
<td style="text-align:left">目标高度，mode = 0时有效</td>
</tr>
<tr>
<td style="text-align:left">backHeight</td>
<td style="text-align:left">int</td>
<td style="text-align:left">实际高度，mode = -4时有效</td>
</tr>
<tr>
<td style="text-align:left">ctrlMode</td>
<td style="text-align:left">int</td>
<td style="text-align:left">控制模式</td>
</tr>
<tr>
<td style="text-align:left">backVol</td>
<td style="text-align:left">string</td>
<td style="text-align:left">反馈电流</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="调节机械臂运动速度">调节机械臂运动速度 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取调节机械臂运动速度<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/velo_move_arm_srv"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"bt_task_msgs/velo_move_arm"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/18"</span><span class="token punctuation">,</span>
        <span class="token property">"joint_name"</span><span class="token operator">:</span> <span class="token string">"joint_6"</span><span class="token punctuation">,</span>
        <span class="token property">"joint_speed"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数值</td>
</tr>
<tr>
<td style="text-align:left">joint_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数值</td>
</tr>
<tr>
<td style="text-align:left">joint_speed</td>
<td style="text-align:left">速度值</td>
<td style="text-align:left">参数值</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
   
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
        <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">12006</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/velo_move_arm_srv"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作设备是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答码,和message内容对应</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体应答消息</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置机械臂模式">设置机械臂模式 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取调节机械臂运动速度<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口,部分机械臂可能不支持，请联系技术人员。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/set_mode_srv"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"bt_task_msgs/set_arm"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/18"</span><span class="token punctuation">,</span>
        <span class="token property">"enable"</span><span class="token operator">:</span> <span class="token string">"joint_6"</span><span class="token punctuation">,</span>
        <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token number">0</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数值</td>
</tr>
<tr>
<td style="text-align:left">enable</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">true:使能机械臂true, false停止使能</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">short</td>
<td style="text-align:left">改变机械臂模式,0:本地控制器控制;1:moveit</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
   
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
        <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">12006</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/set_mode_srv"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作设备是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答码,和message内容对应</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体应答消息</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="设置机械臂位置">设置机械臂位置 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取调节机械臂运动速度<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口,部分机械臂可能不支持，请联系技术人员。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/move_arm_srv"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"bt_task_msgs/move_arm"</span><span class="token punctuation">,</span>
    <span class="token property">"args"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/18"</span><span class="token punctuation">,</span>
        <span class="token property">"joint_angle"</span><span class="token operator">:</span> <span class="token string">"joint_6"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">type</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务类型</td>
</tr>
<tr>
<td style="text-align:left">args</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型请求数据的参数</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">参数值</td>
</tr>
<tr>
<td style="text-align:left">joint_angle</td>
<td style="text-align:left">array</td>
<td style="text-align:left">tfloat类型数组，包含6个关节的角度值，单位°</td>
</tr>
</tbody>
</table>
</li>
<li>
<p><strong>应答数据:</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
   
    <span class="token property">"values"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
        <span class="token property">"code"</span><span class="token operator">:</span> <span class="token number">12006</span><span class="token punctuation">,</span>
        <span class="token property">"success"</span><span class="token operator">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"result"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token property">"service"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/move_arm_srv"</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"service_response"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">调用服务call_service的回复字段"service_response"</td>
</tr>
<tr>
<td style="text-align:left">service</td>
<td style="text-align:left">string</td>
<td style="text-align:left">服务名称</td>
</tr>
<tr>
<td style="text-align:left">result</td>
<td style="text-align:left">bool</td>
<td style="text-align:left">调用服务是否成功</td>
</tr>
<tr>
<td style="text-align:left">values</td>
<td style="text-align:left">object</td>
<td style="text-align:left">服务类型回复数据的参数</td>
</tr>
<tr>
<td style="text-align:left">success</td>
<td style="text-align:left">string</td>
<td style="text-align:left">操作设备是否成功</td>
</tr>
<tr>
<td style="text-align:left">code</td>
<td style="text-align:left">string</td>
<td style="text-align:left">应答码,和message内容对应</td>
</tr>
<tr>
<td style="text-align:left">message</td>
<td style="text-align:left">string</td>
<td style="text-align:left">具体应答消息</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h4 id="机械臂状态">机械臂状态 </h4>
<ul>
<li>
<p><strong>接口说明:</strong><br>
获取机械臂的状态，各轴的角度。<br>
<strong>注意</strong> 必须是由本司提供的机械臂,升降杆,相机才可使用此类接口。</p>
</li>
<li>
<p><strong>请求数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
    <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"bt_task_msgs/arm_state"</span><span class="token punctuation">,</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/arm_state"</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre></li>
<li>
<p><strong>应答数据</strong></p>
<pre data-role="codeBlock" data-info="json" class="language-json json"><code><span class="token punctuation">{</span>
    <span class="token property">"topic"</span><span class="token operator">:</span> <span class="token string">"/agx_arm_task_node/arm_state"</span><span class="token punctuation">,</span>
    <span class="token property">"msg"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
        <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">0</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"joint_angle"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token number">-6.5</span><span class="token punctuation">,</span>
            <span class="token number">69.69999694824219</span><span class="token punctuation">,</span>
            <span class="token number">-170.10000610351562</span><span class="token punctuation">,</span>
            <span class="token number">13.399999618530273</span><span class="token punctuation">,</span>
            <span class="token number">131.39999389648438</span><span class="token punctuation">,</span>
            <span class="token number">71.30000305175781</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        <span class="token property">"arm_name"</span><span class="token operator">:</span> <span class="token string">"agx_realman_63"</span><span class="token punctuation">,</span>
        <span class="token property">"header"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token property">"stamp"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"secs"</span><span class="token operator">:</span> <span class="token number">1708511844</span><span class="token punctuation">,</span>
                <span class="token property">"nsecs"</span><span class="token operator">:</span> <span class="token number">423177229</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token property">"frame_id"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token property">"seq"</span><span class="token operator">:</span> <span class="token number">645</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token property">"state"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"mode"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"error_code"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token property">"id"</span><span class="token operator">:</span> <span class="token string">"arm_192/168/1/18"</span><span class="token punctuation">,</span>
        <span class="token property">"tcp_position"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token number">0</span>
        <span class="token punctuation">]</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">"op"</span><span class="token operator">:</span> <span class="token string">"publish"</span>
<span class="token punctuation">}</span>
</code></pre><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">op</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复"subscribe " &nbsp;固定值publish</td>
</tr>
<tr>
<td style="text-align:left">topic</td>
<td style="text-align:left">string</td>
<td style="text-align:left">回复对应的topic</td>
</tr>
<tr>
<td style="text-align:left">id</td>
<td style="text-align:left">string</td>
<td style="text-align:left">机械臂id</td>
</tr>
<tr>
<td style="text-align:left">header</td>
<td style="text-align:left">obj</td>
<td style="text-align:left">时间戳 详情可参考 <strong><a href="#jump_4">时间戳</a></strong></td>
</tr>
<tr>
<td style="text-align:left">arm_name</td>
<td style="text-align:left">string</td>
<td style="text-align:left">机械臂名称</td>
</tr>
<tr>
<td style="text-align:left">mode</td>
<td style="text-align:left">string</td>
<td style="text-align:left">机械臂名称</td>
</tr>
<tr>
<td style="text-align:left">state</td>
<td style="text-align:left">string</td>
<td style="text-align:left">当前状态：1:执行中，2:就绪，3:暂停，4:停止 5:模式切换异常</td>
</tr>
<tr>
<td style="text-align:left">error_code</td>
<td style="text-align:left">string</td>
<td style="text-align:left">非0时为错误码</td>
</tr>
<tr>
<td style="text-align:left">tcp_position</td>
<td style="text-align:left">string</td>
<td style="text-align:left">臂末端的x,y,z坐标值</td>
</tr>
<tr>
<td style="text-align:left">joint_angle</td>
<td style="text-align:left">string</td>
<td style="text-align:left">机械臂各个关节的角度数组</td>
</tr>
</tbody>
</table>
</li>
</ul>
<h2 id="使用案例指南">使用案例指南 </h2>
<h3 id="建图流程图">建图流程图 </h3>
<ul>
<li>接口使用流程,包含http 接口与websocket 接口,<br>
<strong>注意</strong>:图上未标注接口全称,请自行参考图上文字找到左侧对应的接口。<br>
<img src="mapping.png" alt=""></li>
</ul>
<h3 id="导航流程图">导航流程图 </h3>
<ul>
<li>接口使用流程 ,包含http 接口与websocket 接口<br>
<strong>注意</strong>:图上未标注接口全称,请自行参考图上文字找到左侧对应的接口。<br>
<img src="navigation.png" alt=""></li>
</ul>
<h3 id="获取机器人在地图上的位置流程图">获取机器人在地图上的位置流程图 </h3>
<ul>
<li>接口使用流程 ,包含http 接口与websocket 接口, 获取导航路径在地图上的位置同理<br>
<strong>注意</strong>:图上未标注接口全称,请自行参考图上文字找到左侧对应的接口。<br>
<img src="odom_raw.png" alt=""></li>
</ul>
<h3 id="postman-测试接口">postman 测试接口 </h3>
<h4 id="http-请求">http 请求 </h4>
<ul>
<li>首先使用"登录接口"获取token,数据来源在该接口中, 结果用于其他接口中的Authorization参数值。点击左侧靠"workspace"的"new",在弹窗中选择"http"，即可创建http request，填写的数据步骤如下图所示,具体数据请依据具体请求参数填写。<br>
<img src="http-req1.png" alt=""><br>
<img src="http-req2.png" alt=""></li>
<li>其他接口需要 填写header 中的Authorization, 以及请求类型<br>
<img src="http-req3.png" alt=""></li>
</ul>
<h4 id="websocket-请求">websocket 请求 </h4>
<ul>
<li>点击左侧靠"workspace"的"new",在弹窗中选择"websocket"，即可创建websocket request，填写的数据步骤如下图所示,具体数据请依据具体请求参数填写.<br>
<img src="ws-sub.png" alt=""></li>
</ul>
<h3 id="使用流程">使用流程 </h3>
<ol>
<li>实例化两个客户端http client,websocket client</li>
</ol>
<ul>
<li><code>http client</code>: 用于登录请求以及其他请求,获取token,用于后续请求中的Authorization参数值</li>
<li><code>websocket client</code>:连接ws服务器,定时1s发送心跳包.</li>
</ul>
<ol start="2">
<li>
<p>查看当前导航状态</p>
<ul>
<li>启动录包，名称为'xx'的bag(后续名称保持一致)，保持录包,结束录包。</li>
<li>启动3d建图,结束3d建图</li>
<li>启动2d建图,结束2d建图</li>
</ul>
</li>
<li>
<p>获取地图列表,取得每个地图的时间,id,包含的任务列表.</p>
<ul>
<li>获取名为'xx'的地图信息,包括宽度,高度,原点,分辨率等信息,</li>
<li>下载名为'xx'的地图图片</li>
</ul>
</li>
<li>
<p>使用'xx'地图进行导航</p>
</li>
<li>
<p>png图片坐标与导航地图坐标转换</p>
<ul>
<li>使用windows 系统自带的画图软件打开下载好的地图png,使用鼠标点击图片白色区域任务点,左下角显示该点对应的坐标.</li>
<li>地图信息,根据<code>/map_info?mapName=</code>接口获取当前导航地图的宽度,高度,原点,分辨率信息</li>
<li>每次使用时都需先进行转换,再填写入对应的数据中。</li>
</ul>
</li>
<li>
<p>导航时可进行(包括但不限于以下)的操作</p>
<ul>
<li>初始化位置</li>
<li>发布实时任务</li>
<li>定制任务</li>
<li>发布定制任务</li>
<li>取消正在执行的任务</li>
<li>结束导航</li>
</ul>
</li>
<li>
<p>agilex api 使用demo <a href="https://github.com/agilexrobotics/Navis">c++版本</a></p>
</li>
<li>
<p>使用python编写的使用流程案例<br>
<a id="jump_8" href=""></a></p>
<pre data-role="codeBlock" data-info="python" class="language-python python"><code><span class="token comment">#!/usr/bin/env python</span>
<span class="token keyword keyword-import">import</span> asyncio
<span class="token keyword keyword-from">from</span> websocket  <span class="token keyword keyword-import">import</span> create_connection
<span class="token keyword keyword-import">import</span> websockets
<span class="token keyword keyword-import">import</span> time
<span class="token keyword keyword-import">import</span> requests
<span class="token keyword keyword-import">import</span> json
<span class="token keyword keyword-import">import</span> numpy <span class="token keyword keyword-as">as</span> np
<span class="token keyword keyword-import">import</span> math
<span class="token keyword keyword-from">from</span> threading <span class="token keyword keyword-import">import</span> Thread<span class="token punctuation">,</span> Timer
<span class="token keyword keyword-import">import</span> base64
<span class="token keyword keyword-import">import</span> array
<span class="token keyword keyword-import">import</span> cv2

<span class="token comment"># ws_url = "ws://101.33.245.108:9090" </span>
<span class="token comment"># http_url = "http://101.33.245.108:9358/apiUrl"</span>
ws_url <span class="token operator">=</span> <span class="token string">"ws://10.12.1.126:9090"</span> <span class="token comment">#填写实际的机器人IP地址</span>
http_url <span class="token operator">=</span> <span class="token string">"http://10.12.1.126/apiUrl"</span>
token <span class="token operator">=</span> <span class="token boolean">None</span>

<span class="token keyword keyword-def">def</span> <span class="token function">map_coordinate_to_png</span><span class="token punctuation">(</span>pos<span class="token punctuation">,</span> map_info<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">'''
        坐标转换函数:将导航时实际使用坐标转换成地图png图片坐标。
        输入参数:地图导航时的实际使用坐标, 地图png绑定的yaml信息数据,包含原点,宽度高度,分辨率。
        输出参数:转成png坐标(x,y)
    '''</span> 
    map_pos_x <span class="token operator">=</span> <span class="token punctuation">(</span>pos<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">-</span> map_info<span class="token punctuation">[</span><span class="token string">'originX'</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">/</span> map_info<span class="token punctuation">[</span><span class="token string">'resolution'</span><span class="token punctuation">]</span>
    map_pos_y <span class="token operator">=</span> map_info<span class="token punctuation">[</span><span class="token string">'gridHeight'</span><span class="token punctuation">]</span> <span class="token operator">-</span>  <span class="token punctuation">(</span>pos<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">-</span> map_info<span class="token punctuation">[</span><span class="token string">'originY'</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">/</span> map_info<span class="token punctuation">[</span><span class="token string">'resolution'</span><span class="token punctuation">]</span>
    <span class="token keyword keyword-return">return</span> <span class="token punctuation">(</span>map_pos_x<span class="token punctuation">,</span> map_pos_y<span class="token punctuation">)</span>

<span class="token keyword keyword-def">def</span> <span class="token function">png_coordinate_to_map</span><span class="token punctuation">(</span>pos<span class="token punctuation">,</span> map_info<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">"""
        坐标转换函数:将地图png图片坐标转换成导航时实际使用坐标。
        输入参数:png坐标(x,y), 地图png绑定的yaml信息数据,包含原点,宽度高度,分辨率。
        输出参数:转成后的实际使用坐标
    """</span>

    png_x <span class="token operator">=</span> pos<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">*</span> map_info<span class="token punctuation">[</span><span class="token string">'resolution'</span><span class="token punctuation">]</span> <span class="token operator">+</span> map_info<span class="token punctuation">[</span><span class="token string">'originX'</span><span class="token punctuation">]</span>

    png_y <span class="token operator">=</span> <span class="token punctuation">(</span>map_info<span class="token punctuation">[</span><span class="token string">'gridHeight'</span><span class="token punctuation">]</span> <span class="token operator">-</span> pos<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">*</span> map_info<span class="token punctuation">[</span><span class="token string">'resolution'</span><span class="token punctuation">]</span> <span class="token operator">+</span> map_info<span class="token punctuation">[</span><span class="token string">'originY'</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token keyword keyword-return">return</span> <span class="token punctuation">(</span>png_x<span class="token punctuation">,</span> png_y<span class="token punctuation">)</span>

<span class="token keyword keyword-def">def</span> <span class="token function">quaternion_from_euler</span><span class="token punctuation">(</span>roll<span class="token punctuation">,</span> pitch<span class="token punctuation">,</span> yaw<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">"""
        角度先转成弧度，再转换成四元素,返回四元素
    """</span>
    roll <span class="token operator">=</span> roll <span class="token operator">*</span>  <span class="token punctuation">(</span>math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span>
    pitch <span class="token operator">=</span> pitch <span class="token operator">*</span>  <span class="token punctuation">(</span>math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span>
    yaw <span class="token operator">=</span> yaw <span class="token operator">*</span>  <span class="token punctuation">(</span>math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span>
    qx <span class="token operator">=</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">-</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span>
    qy <span class="token operator">=</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">+</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span>
    qz <span class="token operator">=</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">-</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span>
    qw <span class="token operator">=</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">+</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>roll<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>pitch<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">*</span> np<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>yaw<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-return">return</span> <span class="token punctuation">[</span>qx<span class="token punctuation">,</span> qy<span class="token punctuation">,</span> qz<span class="token punctuation">,</span> qw<span class="token punctuation">]</span>

<span class="token keyword keyword-def">def</span> <span class="token function">quaternion_to_euler</span><span class="token punctuation">(</span>ori<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">"""
    四元素转成弧度，再转换成角度,返回yaw 角度
    """</span>
    roll <span class="token operator">=</span> math<span class="token punctuation">.</span>atan2<span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> <span class="token punctuation">(</span>ori<span class="token punctuation">.</span>w <span class="token operator">*</span> ori<span class="token punctuation">.</span>x <span class="token operator">+</span> ori<span class="token punctuation">.</span>y <span class="token operator">*</span> ori<span class="token punctuation">.</span>z<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">1</span> <span class="token operator">-</span> <span class="token number">2</span> <span class="token operator">*</span> <span class="token punctuation">(</span>ori<span class="token punctuation">.</span>x <span class="token operator">*</span> ori<span class="token punctuation">.</span>x <span class="token operator">+</span> ori<span class="token punctuation">.</span>y <span class="token operator">*</span> ori<span class="token punctuation">.</span>y<span class="token punctuation">)</span><span class="token punctuation">)</span>
    pitch <span class="token operator">=</span> math<span class="token punctuation">.</span>asin<span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> <span class="token punctuation">(</span>ori<span class="token punctuation">.</span>w <span class="token operator">*</span> ori<span class="token punctuation">.</span>y <span class="token operator">-</span> ori<span class="token punctuation">.</span>x <span class="token operator">*</span> ori<span class="token punctuation">.</span>z<span class="token punctuation">)</span><span class="token punctuation">)</span>
    yaw <span class="token operator">=</span> math<span class="token punctuation">.</span>atan2<span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> <span class="token punctuation">(</span>ori<span class="token punctuation">.</span>w <span class="token operator">*</span> ori<span class="token punctuation">.</span>z <span class="token operator">+</span> ori<span class="token punctuation">.</span>x <span class="token operator">*</span> ori<span class="token punctuation">.</span>y<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">1</span> <span class="token operator">-</span> <span class="token number">2</span> <span class="token operator">*</span> <span class="token punctuation">(</span>ori<span class="token punctuation">.</span>z <span class="token operator">*</span> ori<span class="token punctuation">.</span>z <span class="token operator">+</span> ori<span class="token punctuation">.</span>y <span class="token operator">*</span> ori<span class="token punctuation">.</span>y<span class="token punctuation">)</span><span class="token punctuation">)</span>
    math<span class="token punctuation">.</span>degrees<span class="token punctuation">(</span>yaw<span class="token punctuation">)</span>
    <span class="token keyword keyword-return">return</span> yaw

<span class="token keyword keyword-class">class</span> <span class="token class-name">WSClient</span><span class="token punctuation">:</span>
    <span class="token keyword keyword-def">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> address<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>ws <span class="token operator">=</span> create_connection<span class="token punctuation">(</span>address<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>isconnect <span class="token operator">=</span> <span class="token boolean">True</span>
        self<span class="token punctuation">.</span>input_data <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"call_service"</span><span class="token punctuation">,</span>
            <span class="token string">"service"</span><span class="token punctuation">:</span> <span class="token string">"/input/op"</span><span class="token punctuation">,</span>
            <span class="token string">"type"</span><span class="token punctuation">:</span><span class="token string">"tools_msgs/input"</span><span class="token punctuation">,</span>
            <span class="token string">"args"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                <span class="token string">"file_name"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token string">"op_type"</span><span class="token punctuation">:</span><span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token string">"id_type"</span><span class="token punctuation">:</span><span class="token string">""</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">send_msg</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword keyword-if">if</span> self<span class="token punctuation">.</span>ws <span class="token keyword keyword-is">is</span> <span class="token keyword keyword-not">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            msg <span class="token operator">=</span> json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>args<span class="token punctuation">,</span> ensure_ascii<span class="token operator">=</span><span class="token boolean">False</span><span class="token punctuation">)</span><span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">"utf-8"</span><span class="token punctuation">)</span>
            self<span class="token punctuation">.</span>ws<span class="token punctuation">.</span>send<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>
            
            <span class="token keyword keyword-return">return</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>self<span class="token punctuation">.</span>ws<span class="token punctuation">.</span>recv<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">get_bytes_data</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword keyword-if">if</span> self<span class="token punctuation">.</span>ws <span class="token keyword keyword-is">is</span> <span class="token keyword keyword-not">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            msg <span class="token operator">=</span> json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>args<span class="token punctuation">,</span> ensure_ascii<span class="token operator">=</span><span class="token boolean">False</span><span class="token punctuation">)</span><span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">"utf-8"</span><span class="token punctuation">)</span>
            self<span class="token punctuation">.</span>ws<span class="token punctuation">.</span>send<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>
        
            <span class="token keyword keyword-return">return</span> self<span class="token punctuation">.</span>ws<span class="token punctuation">.</span>recv<span class="token punctuation">(</span><span class="token punctuation">)</span>
        

    <span class="token keyword keyword-def">def</span> <span class="token function">publish_data</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword keyword-if">if</span> self<span class="token punctuation">.</span>ws <span class="token keyword keyword-is">is</span> <span class="token keyword keyword-not">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            msg <span class="token operator">=</span> json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>args<span class="token punctuation">,</span> ensure_ascii<span class="token operator">=</span><span class="token boolean">False</span><span class="token punctuation">)</span><span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">"utf-8"</span><span class="token punctuation">)</span>
            self<span class="token punctuation">.</span>ws<span class="token punctuation">.</span>send<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>
        
    <span class="token keyword keyword-def">def</span> <span class="token function">heart_beat</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
    
        <span class="token keyword keyword-if">if</span> self<span class="token punctuation">.</span>isconnect <span class="token operator">==</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
            message <span class="token operator">=</span> <span class="token punctuation">{</span> 
                <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"ping"</span><span class="token punctuation">,</span>
                <span class="token string">"timeStamp"</span><span class="token punctuation">:</span> <span class="token builtin">str</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">*</span><span class="token number">1000</span><span class="token punctuation">)</span><span class="token punctuation">.</span>split<span class="token punctuation">(</span><span class="token string">"."</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
            <span class="token punctuation">}</span>
            res <span class="token operator">=</span> self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>message<span class="token punctuation">)</span>
            <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
            
            
        
    <span class="token keyword keyword-def">def</span> <span class="token function">on_close</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword keyword-if">if</span> self<span class="token punctuation">.</span>ws <span class="token keyword keyword-is">is</span> <span class="token keyword keyword-not">not</span> <span class="token boolean">None</span> <span class="token keyword keyword-and">and</span> self<span class="token punctuation">.</span>isconnect<span class="token punctuation">:</span>
            self<span class="token punctuation">.</span>ws<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
            self<span class="token punctuation">.</span>isconnect <span class="token operator">=</span> <span class="token boolean">False</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">call_input</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> op_type<span class="token punctuation">,</span> id_type<span class="token punctuation">,</span> file_name <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>input_data<span class="token punctuation">[</span><span class="token string">'args'</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token string">'file_name'</span><span class="token punctuation">]</span> <span class="token operator">=</span> file_name
        self<span class="token punctuation">.</span>input_data<span class="token punctuation">[</span><span class="token string">'args'</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token string">'op_type'</span><span class="token punctuation">]</span> <span class="token operator">=</span> id_type
        self<span class="token punctuation">.</span>input_data<span class="token punctuation">[</span><span class="token string">'args'</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token string">'id_type'</span><span class="token punctuation">]</span> <span class="token operator">=</span> op_type

        <span class="token keyword keyword-return">return</span> self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>self<span class="token punctuation">.</span>input_data<span class="token punctuation">)</span>
    
    <span class="token keyword keyword-def">def</span> <span class="token function">record_bag</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> idtype<span class="token punctuation">,</span> filename <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>call_input<span class="token punctuation">(</span>op_type <span class="token operator">=</span> <span class="token string">'record_data'</span><span class="token punctuation">,</span>id_type<span class="token operator">=</span>idtype<span class="token punctuation">,</span> file_name<span class="token operator">=</span>filename<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">mapping_3d</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> idtype<span class="token punctuation">,</span> filename <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        res <span class="token operator">=</span> self<span class="token punctuation">.</span>call_input<span class="token punctuation">(</span>op_type <span class="token operator">=</span> <span class="token string">'map_3d'</span><span class="token punctuation">,</span>id_type<span class="token operator">=</span>idtype<span class="token punctuation">,</span> file_name<span class="token operator">=</span>filename<span class="token punctuation">)</span>
    
    <span class="token keyword keyword-def">def</span> <span class="token function">mapping_2d</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> idtype<span class="token punctuation">,</span> filename <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        res <span class="token operator">=</span> self<span class="token punctuation">.</span>call_input<span class="token punctuation">(</span>op_type <span class="token operator">=</span> <span class="token string">'map_2d'</span><span class="token punctuation">,</span>id_type<span class="token operator">=</span>idtype<span class="token punctuation">,</span> file_name<span class="token operator">=</span>filename<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">follow_line</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> idtype<span class="token punctuation">,</span> filename <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        res <span class="token operator">=</span> self<span class="token punctuation">.</span>call_input<span class="token punctuation">(</span>op_type <span class="token operator">=</span> <span class="token string">'follow_line'</span><span class="token punctuation">,</span>id_type<span class="token operator">=</span>idtype<span class="token punctuation">,</span> file_name<span class="token operator">=</span>filename<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">initial_pos</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> pos<span class="token punctuation">:</span><span class="token builtin">list</span><span class="token punctuation">,</span> angle<span class="token punctuation">)</span><span class="token punctuation">:</span>
        qua <span class="token operator">=</span> quaternion_from_euler<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> angle <span class="token operator">*</span> <span class="token punctuation">(</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span>  <span class="token operator">*</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span>

        msg <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"publish"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/initialpose"</span><span class="token punctuation">,</span>
            <span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"geometry_msgs/PoseWithCovarianceStamped"</span><span class="token punctuation">,</span>
            <span class="token string">"msg"</span><span class="token punctuation">:</span><span class="token punctuation">{</span>
                <span class="token string">"header"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token string">"frame_id"</span><span class="token punctuation">:</span><span class="token string">"map_2d"</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token string">"pose"</span><span class="token punctuation">:</span><span class="token punctuation">{</span>
                    <span class="token string">"pose"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                        <span class="token string">"position"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                            <span class="token string">"x"</span><span class="token punctuation">:</span> pos<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                            <span class="token string">"y"</span><span class="token punctuation">:</span> pos<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                            <span class="token string">"z"</span><span class="token punctuation">:</span> <span class="token number">0</span>
                        <span class="token punctuation">}</span><span class="token punctuation">,</span>
                        <span class="token string">"orientation"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                            <span class="token string">"w"</span><span class="token punctuation">:</span> qua<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                            <span class="token string">"z"</span><span class="token punctuation">:</span> qua<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                            <span class="token string">"y"</span><span class="token punctuation">:</span> qua<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                            <span class="token string">"x"</span><span class="token punctuation">:</span> qua<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
                        <span class="token punctuation">}</span>
                    <span class="token punctuation">}</span><span class="token punctuation">,</span>
                    <span class="token string">"covariance"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
                        <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span>
                    <span class="token punctuation">]</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
        self<span class="token punctuation">.</span>publish_data<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">sub_slam_status</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>   
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/slam_status"</span>
            <span class="token comment"># "type":"nav_msgs/Odometry" </span>
        <span class="token punctuation">}</span>
    
        res <span class="token operator">=</span> self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">sub_robot_status</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>   
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/dash_board/robot_status"</span>
        <span class="token punctuation">}</span>
        <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span><span class="token string">'task_status = '</span><span class="token punctuation">,</span>self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>msg<span class="token punctuation">)</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">cancel_nav</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>
                <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"publish"</span><span class="token punctuation">,</span>
                <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/run_management/navi_task/cancel"</span><span class="token punctuation">,</span>
                <span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"actionlib_msgs/GoalID"</span><span class="token punctuation">,</span>
                <span class="token string">"msg"</span><span class="token punctuation">:</span><span class="token punctuation">{</span>
                    <span class="token string">"stamp"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                        <span class="token string">"secs"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                        <span class="token string">"nsecs"</span><span class="token punctuation">:</span> <span class="token number">0</span>
                    <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">""</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
        self<span class="token punctuation">.</span>publish_data<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">start_heartbeat_timer</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> interval<span class="token punctuation">)</span><span class="token punctuation">:</span>
        
        self<span class="token punctuation">.</span>timer <span class="token operator">=</span> threading<span class="token punctuation">.</span>Timer<span class="token punctuation">(</span>interval<span class="token punctuation">,</span> self<span class="token punctuation">.</span>start_heartbeat_timer<span class="token punctuation">,</span> <span class="token punctuation">(</span>interval<span class="token punctuation">,</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>timer<span class="token punctuation">.</span>start<span class="token punctuation">(</span><span class="token punctuation">)</span>

        self<span class="token punctuation">.</span>heart_beat<span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">stop_heartbeat_timer</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>timer<span class="token punctuation">.</span>cancel<span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">sub_pointCloud2</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>   
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/points_raw"</span>
            <span class="token comment">#"compression": "cbor" #如果带有这条字段,获取到的是bytes，</span>
        <span class="token punctuation">}</span>
        
        <span class="token comment"># compression 字段使用下面接口获取数据</span>
        <span class="token comment"># res = self.get_bytes_data(msg)</span>
        <span class="token comment"># data_array = array.array('B',res)</span>
        <span class="token comment"># print(data_array)</span>


        <span class="token comment"># 无compression 字段使用默认的发送数据接口</span>
        res <span class="token operator">=</span> self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>
        data<span class="token operator">=</span> res<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">"msg"</span><span class="token punctuation">)</span><span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">"data"</span><span class="token punctuation">)</span>   
        decode_data <span class="token operator">=</span> base64<span class="token punctuation">.</span>b64decode<span class="token punctuation">(</span>data<span class="token punctuation">,</span> altchars<span class="token operator">=</span><span class="token boolean">None</span><span class="token punctuation">)</span>
        data_array <span class="token operator">=</span> array<span class="token punctuation">.</span>array<span class="token punctuation">(</span><span class="token string">'B'</span><span class="token punctuation">,</span>decode_data<span class="token punctuation">)</span>
        <span class="token comment"># print(data_array)</span>


    <span class="token keyword keyword-def">def</span> <span class="token function">sub_scan</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>   
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/scan"</span><span class="token punctuation">,</span>
            <span class="token string">"compression"</span><span class="token punctuation">:</span> <span class="token string">"cbor"</span> <span class="token comment">#如果带有这条字段,获取到的是bytes，</span>

        <span class="token punctuation">}</span>
    
        <span class="token comment"># 有compression 字段使用下面接口获取数据</span>
        res <span class="token operator">=</span> self<span class="token punctuation">.</span>get_bytes_data<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>
        data_array <span class="token operator">=</span> array<span class="token punctuation">.</span>array<span class="token punctuation">(</span><span class="token string">'B'</span><span class="token punctuation">,</span>res<span class="token punctuation">)</span>
        <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span>data_array<span class="token punctuation">)</span>
        
        <span class="token comment"># 无compression 字段使用默认的发送数据接口</span>
        <span class="token comment"># res = self.send_msg(msg)</span>
        <span class="token comment"># data= res.get("msg").get("ranges")</span>
        <span class="token comment"># print(data)    </span>

    <span class="token keyword keyword-def">def</span> <span class="token function">sub_camera_pointCloud</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>   
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/camera/color/image_raw"</span>
            <span class="token comment"># "compression": "cbor" </span>
        <span class="token punctuation">}</span>
    
        <span class="token comment"># compression 字段使用下面接口获取数据</span>
        message <span class="token operator">=</span> self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>msg<span class="token punctuation">)</span>
        <span class="token comment"># data_array = array.array('B',message)</span>
        
        image_data <span class="token operator">=</span> message<span class="token punctuation">[</span><span class="token string">"msg"</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token string">'data'</span><span class="token punctuation">]</span>
        
        decode_data <span class="token operator">=</span> base64<span class="token punctuation">.</span>b64decode<span class="token punctuation">(</span>image_data<span class="token punctuation">,</span> altchars<span class="token operator">=</span><span class="token boolean">None</span><span class="token punctuation">)</span>
        img_array <span class="token operator">=</span> array<span class="token punctuation">.</span>array<span class="token punctuation">(</span><span class="token string">'B'</span><span class="token punctuation">,</span>decode_data<span class="token punctuation">)</span>
        <span class="token comment"># img_array = bytearray('B', image_data)</span>
        img_array <span class="token operator">=</span> np<span class="token punctuation">.</span>frombuffer<span class="token punctuation">(</span>img_array<span class="token punctuation">,</span> np<span class="token punctuation">.</span>uint8<span class="token punctuation">)</span>
    
        <span class="token comment"># print(img_array)</span>
        image_ <span class="token operator">=</span> cv2<span class="token punctuation">.</span>imdecode<span class="token punctuation">(</span>img_array<span class="token punctuation">,</span> cv2<span class="token punctuation">.</span>IMREAD_COLOR<span class="token punctuation">)</span>
        image_name <span class="token operator">=</span> <span class="token string">R"E:\workspace\userapi\test\te.jpg"</span>
        cv2<span class="token punctuation">.</span>imwrite<span class="token punctuation">(</span>image_name<span class="token punctuation">,</span> image_<span class="token punctuation">)</span>

        <span class="token comment"># # Build the image format and dimensions</span>
        <span class="token comment"># format = message['encoding']</span>
        <span class="token comment"># width = message['width']</span>
        <span class="token comment"># height = message['height']</span>

        <span class="token comment"># # Build the PIL Image object</span>
        <span class="token comment"># # image = Image.frombytes(format, (width, height), base64.b64decode(image_data))</span>
        <span class="token comment"># image = Image.frombytes(format, (width, height), image_data)</span>

        <span class="token comment"># # Save the image as a picture file</span>
    
        <span class="token comment"># image.save(image_name)</span>
        
    <span class="token keyword keyword-def">def</span> <span class="token function">sub_task_status</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        msg <span class="token operator">=</span> <span class="token punctuation">{</span>   
            <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"subscribe"</span><span class="token punctuation">,</span>
            <span class="token string">"topic"</span><span class="token punctuation">:</span> <span class="token string">"/run_management/task_status"</span>
        <span class="token punctuation">}</span>
        <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span><span class="token string">'/run_management/task_status = '</span><span class="token punctuation">,</span>self<span class="token punctuation">.</span>send_msg<span class="token punctuation">(</span>msg<span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token keyword keyword-class">class</span> <span class="token class-name">HttpClient</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword keyword-def">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> url<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>url <span class="token operator">=</span> url
        self<span class="token punctuation">.</span>token <span class="token operator">=</span> <span class="token boolean">None</span>
        self<span class="token punctuation">.</span>map_list <span class="token operator">=</span> <span class="token boolean">None</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">login_</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">'/user/passport/login'</span>

        payload <span class="token operator">=</span> json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span><span class="token punctuation">{</span>
            <span class="token string">"username"</span><span class="token punctuation">:</span> <span class="token string">"agilex"</span><span class="token punctuation">,</span>
            <span class="token string">"password"</span><span class="token punctuation">:</span> <span class="token string">"NTdhMTE5NGNiMDczY2U4YjNiYjM2NWU0YjgwNWE5YWU="</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span>
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Content-Type'</span><span class="token punctuation">:</span> <span class="token string">'application/json'</span>
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"POST"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">,</span> data<span class="token operator">=</span>payload<span class="token punctuation">)</span>
        token <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>response<span class="token punctuation">.</span>text<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>token <span class="token operator">=</span> token<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'data'</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">get_maplist</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">"/map_list?page=1&amp;limit=-1&amp;sortType=&amp;reverse="</span>
        
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Authorization'</span><span class="token punctuation">:</span> self<span class="token punctuation">.</span>token
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"GET"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">)</span>
        res_json <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>response<span class="token punctuation">.</span>text<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>map_list <span class="token operator">=</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'data'</span><span class="token punctuation">)</span>
        <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span><span class="token string">'aaa'</span><span class="token punctuation">,</span> self<span class="token punctuation">.</span>map_list<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">get_map_png</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> map_name<span class="token punctuation">)</span><span class="token punctuation">:</span>
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">"/downloadpng?mapName="</span> <span class="token operator">+</span> map_name
        
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Authorization'</span><span class="token punctuation">:</span> self<span class="token punctuation">.</span>token<span class="token punctuation">,</span>
            <span class="token string">'Content-Type'</span><span class="token punctuation">:</span> <span class="token string">'application/x-www-form-urlencoded'</span>
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"GET"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">)</span>
        
        filepath <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token string">r'C:\Users\admin\Desktop\/{}.png'</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>map_name<span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword keyword-with">with</span> <span class="token builtin">open</span><span class="token punctuation">(</span>filepath<span class="token punctuation">,</span> <span class="token string">'wb'</span><span class="token punctuation">)</span> <span class="token keyword keyword-as">as</span> f<span class="token punctuation">:</span>
            f<span class="token punctuation">.</span>write<span class="token punctuation">(</span>response<span class="token punctuation">.</span>content<span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">get_map_info</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> map_name<span class="token punctuation">)</span><span class="token punctuation">:</span>
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">"/map_info?mapName="</span> <span class="token operator">+</span> map_name <span class="token comment">#mapName是单个地图名称，不用包含.png</span>
        
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Authorization'</span><span class="token punctuation">:</span> self<span class="token punctuation">.</span>token<span class="token punctuation">,</span>
            <span class="token string">'Content-Type'</span><span class="token punctuation">:</span> <span class="token string">'application/json'</span>
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"GET"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">)</span>
        
        res_json <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>response<span class="token punctuation">.</span>text<span class="token punctuation">)</span>
        <span class="token keyword keyword-if">if</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'data'</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword keyword-return">return</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'data'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">'mapInfo'</span><span class="token punctuation">]</span>
        <span class="token keyword keyword-else">else</span><span class="token punctuation">:</span>
            <span class="token keyword keyword-return">return</span> <span class="token boolean">None</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">run_realtime_task</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> pos<span class="token punctuation">:</span><span class="token builtin">list</span><span class="token punctuation">)</span><span class="token punctuation">:</span>

        payload <span class="token operator">=</span> json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>
        <span class="token punctuation">{</span>
            <span class="token string">"loopTime"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span> 
            <span class="token string">"points"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span> 
                <span class="token string">"position"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                    <span class="token string">"x"</span><span class="token punctuation">:</span> pos<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                    <span class="token string">"y"</span><span class="token punctuation">:</span> pos<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                    <span class="token string">"theta"</span><span class="token punctuation">:</span> pos<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token string">"isNew"</span><span class="token punctuation">:</span> <span class="token boolean">False</span><span class="token punctuation">,</span>
                <span class="token string">"cpx"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token string">"cpy"</span><span class="token punctuation">:</span> <span class="token number">0</span>
            <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"mode"</span><span class="token punctuation">:</span> <span class="token string">"point"</span><span class="token comment"># mode = path 时需要设置多个点,进行路径导航</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span>
        
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">"/realtime_task"</span>
        
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Authorization'</span><span class="token punctuation">:</span> self<span class="token punctuation">.</span>token<span class="token punctuation">,</span>
            <span class="token string">'Content-Type'</span><span class="token punctuation">:</span> <span class="token string">'application/json'</span>
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"POST"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">,</span>data<span class="token operator">=</span>payload<span class="token punctuation">)</span>
        res_json <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>response<span class="token punctuation">.</span>text<span class="token punctuation">)</span>

        <span class="token keyword keyword-if">if</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'code'</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span> <span class="token keyword keyword-or">or</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'successed'</span><span class="token punctuation">)</span><span class="token operator">==</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
            <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span><span class="token string">'success~~~'</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">run_list_task</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> map_name<span class="token punctuation">,</span> task_name<span class="token punctuation">,</span> looptime<span class="token punctuation">:</span> <span class="token builtin">int</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        payload <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">"mapName"</span><span class="token punctuation">:</span> map_name<span class="token punctuation">,</span> 
            <span class="token string">"taskName"</span><span class="token punctuation">:</span> task_name<span class="token punctuation">,</span>
            <span class="token string">"loopTime"</span><span class="token punctuation">:</span>looptime
        <span class="token punctuation">}</span>
        
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">"/run_list_task"</span>
        
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Authorization'</span><span class="token punctuation">:</span> self<span class="token punctuation">.</span>token<span class="token punctuation">,</span>
            <span class="token string">'Content-Type'</span><span class="token punctuation">:</span> <span class="token string">'application/json'</span>
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"POST"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">,</span> data<span class="token operator">=</span>json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>payload<span class="token punctuation">)</span><span class="token punctuation">)</span>
    
        res_json <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>response<span class="token punctuation">.</span>text<span class="token punctuation">)</span>
        <span class="token keyword keyword-if">if</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'success'</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
            <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span><span class="token string">'success~~~'</span><span class="token punctuation">)</span>

    <span class="token keyword keyword-def">def</span> <span class="token function">set_list_task</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        payload <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">"mode"</span><span class="token punctuation">:</span> <span class="token string">"point"</span><span class="token punctuation">,</span>
            <span class="token string">"speed"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
            <span class="token string">"evadible"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
            <span class="token string">"points"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
                <span class="token punctuation">{</span>
                <span class="token string">"isNew"</span><span class="token punctuation">:</span> <span class="token boolean">True</span><span class="token punctuation">,</span>
                <span class="token string">"index"</span><span class="token punctuation">:</span> <span class="token string">"point-1"</span><span class="token punctuation">,</span>
                <span class="token string">"pointType"</span><span class="token punctuation">:</span> <span class="token string">"navigation"</span><span class="token punctuation">,</span>
                <span class="token string">"pointName"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token string">"actions"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                <span class="token string">"position"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
                    <span class="token string">"x"</span><span class="token punctuation">:</span> <span class="token operator">-</span><span class="token number">3.35</span><span class="token punctuation">,</span>
                    <span class="token string">"y"</span><span class="token punctuation">:</span> <span class="token number">37.48</span><span class="token punctuation">,</span>
                    <span class="token string">"theta"</span><span class="token punctuation">:</span> <span class="token number">78.24</span>   
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token string">"cpx"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token string">"cpy"</span><span class="token punctuation">:</span> <span class="token number">0</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token punctuation">{</span>
                <span class="token string">"isNew"</span><span class="token punctuation">:</span> <span class="token boolean">True</span><span class="token punctuation">,</span>
                <span class="token string">"index"</span><span class="token punctuation">:</span> <span class="token string">"point-2"</span><span class="token punctuation">,</span>
                <span class="token string">"pointType"</span><span class="token punctuation">:</span> <span class="token string">"navigation"</span><span class="token punctuation">,</span>
                <span class="token string">"pointName"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
                <span class="token string">"actions"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
                <span class="token string">"position"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>     
                    <span class="token string">"x"</span><span class="token punctuation">:</span> <span class="token operator">-</span><span class="token number">2.45</span><span class="token punctuation">,</span>
                    <span class="token string">"y"</span><span class="token punctuation">:</span> <span class="token number">34.53</span><span class="token punctuation">,</span>
                    <span class="token string">"theta"</span><span class="token punctuation">:</span> <span class="token number">169.32</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token string">"cpx"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
                <span class="token string">"cpy"</span><span class="token punctuation">:</span> <span class="token number">0</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"mapName"</span><span class="token punctuation">:</span> <span class="token string">"office"</span><span class="token punctuation">,</span>
            <span class="token string">"taskName"</span><span class="token punctuation">:</span> <span class="token string">"p1"</span><span class="token punctuation">,</span>
            <span class="token string">"editedName"</span><span class="token punctuation">:</span> <span class="token string">"p1"</span><span class="token punctuation">,</span>
            <span class="token string">"gridItemIdx"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
            <span class="token string">"remark"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
            <span class="token string">"personName"</span><span class="token punctuation">:</span> <span class="token string">""</span>
        <span class="token punctuation">}</span>

        url <span class="token operator">=</span> self<span class="token punctuation">.</span>url <span class="token operator">+</span> <span class="token string">"/set_task"</span>
        
        headers <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token string">'Authorization'</span><span class="token punctuation">:</span> self<span class="token punctuation">.</span>token<span class="token punctuation">,</span>
            <span class="token string">'Content-Type'</span><span class="token punctuation">:</span> <span class="token string">'application/json'</span>
        <span class="token punctuation">}</span>

        response <span class="token operator">=</span> requests<span class="token punctuation">.</span>request<span class="token punctuation">(</span><span class="token string">"POST"</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> headers<span class="token operator">=</span>headers<span class="token punctuation">,</span> data<span class="token operator">=</span>json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>payload<span class="token punctuation">)</span><span class="token punctuation">)</span>

        res_json <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>response<span class="token punctuation">.</span>text<span class="token punctuation">)</span>
        <span class="token keyword keyword-if">if</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'code'</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span> <span class="token keyword keyword-or">or</span> res_json<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">'successed'</span><span class="token punctuation">)</span><span class="token operator">==</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
            <span class="token keyword keyword-print">print</span><span class="token punctuation">(</span><span class="token string">'set task success~~~'</span><span class="token punctuation">)</span>


<span class="token keyword keyword-import">import</span> threading
<span class="token keyword keyword-if">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token comment">### Http 客户端</span>
    http_client <span class="token operator">=</span>  HttpClient<span class="token punctuation">(</span>http_url<span class="token punctuation">)</span>
    http_client<span class="token punctuation">.</span>login_<span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token comment">### websocket 客户端</span>
    ws_client <span class="token operator">=</span>  WSClient<span class="token punctuation">(</span>ws_url<span class="token punctuation">)</span>
    <span class="token comment">## 定时发送心跳包</span>
    ws_client<span class="token punctuation">.</span>start_heartbeat_timer<span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span>

    <span class="token comment">###  订阅设备当前导航状态</span>
    ws_client<span class="token punctuation">.</span>sub_task_status<span class="token punctuation">(</span><span class="token punctuation">)</span>
    ws_client<span class="token punctuation">.</span>sub_robot_status<span class="token punctuation">(</span><span class="token punctuation">)</span>
    ws_client<span class="token punctuation">.</span>sub_slam_status<span class="token punctuation">(</span><span class="token punctuation">)</span>


    <span class="token comment">###  订阅激光雷达3D点云数据</span>
    <span class="token comment"># ws_client.sub_pointCloud2()</span>

    <span class="token comment">###  订阅激光雷达2D点云数据,只有在开启导航的情况下才会订阅得到数据</span>
    <span class="token comment"># ws_client.sub_scan()</span>

    <span class="token comment">##  订阅相机数据</span>
    <span class="token comment"># data1 =  ws_client.sub_camera_pointCloud()</span>

    <span class="token comment"># save_image(data1)</span>
    
    map_name <span class="token operator">=</span> <span class="token string">'office'</span>

    <span class="token triple-quoted-string string">'''
    ### 录包-&gt;建图-&gt;启动导航-&gt;流程
    
    ### 启动录包,间隔10秒结束录包,可以根据实际需求设置实际
    time_1 = 10
    time_2 = 5
    ws_client.record_bag(idtype="start", filename=map_name)
    time.sleep(time_1)

    ws_client.record_bag(idtype="stop", filename=map_name)
    time.sleep(time_2)

    ### 启动3d建图,间隔10秒结束3d建图
    ws_client.mapping_3d(idtype="start", filename=map_name)
    time.sleep(time_1)

    ws_client.mapping_3d(idtype="stop", filename=map_name)
    time.sleep(time_2)

    ### 启动2d建图,间隔10秒结束2d建图
    ws_client.mapping_2d(idtype="start", filename=map_name)
    time.sleep(time_1)
    ws_client.mapping_2d(idtype="stop", filename=map_name)
    time.sleep(time_2)

    ### 启动导航
    ws_client.follow_line(idtype="start", filename=map_name)
    '''</span>

    <span class="token comment">###获取地图列表</span>
    <span class="token comment"># http_client.get_maplist()</span>

    <span class="token comment">###获取某张地图</span>
    <span class="token comment"># http_client.get_map_png(map_name),#下载到本地,路径需修改,</span>

    <span class="token comment">### 获取地图对应的信息</span>
    <span class="token comment"># map_info = http_client.get_map_info(map_name)</span>
    <span class="token comment"># print(map_info)</span>

    <span class="token comment">### 使用windows 系统自带的画图软件打开下载好的地图png,使用鼠标点击图片白色区域任务点,左下角显示该点对应的坐标</span>
    <span class="token comment">### 使用,标转换成地图真实坐标，如下坐标[x,y]</span>
    <span class="token comment"># png_coor = [960,275]</span>
    <span class="token comment"># if map_info:</span>
    <span class="token comment">#     pos_x,pos_y =  png_coordinate_to_map(png_coor, map_info)</span>
    <span class="token comment">#     print("1 ",pos_x, pos_y)</span>



    <span class="token comment">## 设置初始化点</span>
    <span class="token comment"># ws_client.initial_pos([pos_x, pos_y], 80)</span>

    <span class="token comment">### 设置导航目标点,执行实时任务</span>
    <span class="token comment"># http_client.run_realtime_task([pos_x, pos_y, 80])</span>

    <span class="token comment">### 设置列表任务</span>
    <span class="token comment"># http_client.set_list_task()</span>

    <span class="token comment">### 执行列表任务</span>
    <span class="token comment"># http_client.run_list_task(map_name=map_name, task_name='p1', looptime=1)</span>

    <span class="token comment">### 结束任务</span>
    <span class="token comment"># ws_client.cancel_nav()</span>

    <span class="token comment">### 关闭导航</span>
    <span class="token comment">#ws_client.follow_line(idtype="stop", filename=map_name)</span>

    <span class="token comment"># ws_client.on_close()</span>


</code></pre></li>
</ol>

      </div>
      <div class="md-sidebar-toc">
<div class="md-toc">
<details style="padding:0;;padding-left:0px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#agilex-导航模块api" class="md-toc-link"><p>Agilex 导航模块API</p>
</a>
          </summary>
        <div>
          <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#关于文档" class="md-toc-link"><p>关于文档</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#使用说明" class="md-toc-link">
            <p>使用说明</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#发布说明" class="md-toc-link">
            <p>发布说明</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#注意事项" class="md-toc-link">
            <p>注意事项</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#http-api" class="md-toc-link"><p>HTTP API</p>
</a>
          </summary>
        <div>
          <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#登录接口" class="md-toc-link"><p>登录接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#登录请求" class="md-toc-link">
            <p>登录请求</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#地图相关接口" class="md-toc-link"><p>地图相关接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#建图导航注意事项" class="md-toc-link">
            <p>建图导航注意事项</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#录包建图导航" class="md-toc-link">
            <p>录包建图导航</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取地图列表" class="md-toc-link">
            <p>获取地图列表</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取某个地图信息" class="md-toc-link">
            <p>获取某个地图信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#下载某个地图图片" class="md-toc-link">
            <p>下载某个地图图片</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#重命名某个地图" class="md-toc-link">
            <p>重命名某个地图</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#删除地图文件" class="md-toc-link">
            <p>删除地图文件</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#导出某个地图包" class="md-toc-link">
            <p>导出某个地图包</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#导入某个地图包" class="md-toc-link">
            <p>导入某个地图包</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#批量导出地图包" class="md-toc-link">
            <p>批量导出地图包</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#任务相关接口" class="md-toc-link"><p>任务相关接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#地图图片坐标转成地图坐标" class="md-toc-link">
            <p>地图图片坐标转成地图坐标</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#地图坐标转成图片像素坐标" class="md-toc-link">
            <p>地图坐标转成图片像素坐标</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取某个地图某个任务信息" class="md-toc-link">
            <p>获取某个地图某个任务信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置某个地图的某个任务信息" class="md-toc-link">
            <p>设置某个地图的某个任务信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#删除某个地图的某个任务" class="md-toc-link">
            <p>删除某个地图的某个任务</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#对当前导航的地图执行实时任务" class="md-toc-link">
            <p>对当前导航的地图执行实时任务</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#对当前导航的地图执行列表任务" class="md-toc-link">
            <p>对当前导航的地图执行列表任务</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#版本信息" class="md-toc-link"><p>版本信息</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取软件版本信息" class="md-toc-link">
            <p>获取软件版本信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取设备版本信息" class="md-toc-link">
            <p>获取设备版本信息</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#相机相关接口" class="md-toc-link"><p>相机相关接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取相机列表" class="md-toc-link">
            <p>获取相机列表</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#添加相机视频流" class="md-toc-link">
            <p>添加相机视频流</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置某个相机视频流" class="md-toc-link">
            <p>设置某个相机视频流</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#删除某个相机视频流" class="md-toc-link">
            <p>删除某个相机视频流</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#定时任务相关接口" class="md-toc-link"><p>定时任务相关接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取定时任务列表" class="md-toc-link">
            <p>获取定时任务列表</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置定时任务状态" class="md-toc-link">
            <p>设置定时任务状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取新增设备列表" class="md-toc-link">
            <p>获取新增设备列表</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#保存新增设备" class="md-toc-link">
            <p>保存新增设备</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取设备动作列表" class="md-toc-link">
            <p>获取设备动作列表</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#新增设备增加动作" class="md-toc-link">
            <p>新增设备增加动作</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#软件中断动作恢复接口" class="md-toc-link">
            <p>软件中断动作，恢复接口</p>

          </a></div>
        </div>
      </details>
    
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#websocket-api" class="md-toc-link"><p>websocket API</p>
</a>
          </summary>
        <div>
          <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#通用指令介绍" class="md-toc-link"><p>通用指令介绍</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#subcribe请求" class="md-toc-link">
            <p>SUBCRIBE请求</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#call_service请求" class="md-toc-link">
            <p>CALL_SERVICE请求</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#publish请求" class="md-toc-link">
            <p>PUBLISH请求</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#通用案例" class="md-toc-link">
            <p>通用案例</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#注意事项-1" class="md-toc-link">
            <p>注意事项</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#二次开发必要接口" class="md-toc-link">
            <p>(二次开发必要接口)</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#机器人状态信息" class="md-toc-link"><p>机器人状态信息</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设备当前状态" class="md-toc-link">
            <p>设备当前状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取机器人底盘数据" class="md-toc-link">
            <p>获取机器人底盘数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取机器人电池状态" class="md-toc-link">
            <p>获取机器人电池状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取机器人充电信息" class="md-toc-link">
            <p>获取机器人充电信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设备传感器状态" class="md-toc-link">
            <p>设备传感器状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#rtk-gps传感器数据" class="md-toc-link">
            <p>RTK-GPS传感器数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#imu信息" class="md-toc-link">
            <p>imu信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#激光雷达传感器3d点云数据" class="md-toc-link">
            <p>激光雷达传感器3D点云数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#激光雷达传感器2d点云数据" class="md-toc-link">
            <p>激光雷达传感器2D点云数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#激光雷达传感器导航时位置" class="md-toc-link">
            <p>激光雷达传感器导航时位置</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#相机rgb图像数据" class="md-toc-link">
            <p>相机RGB图像数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#相机depth图像数据" class="md-toc-link">
            <p>相机depth图像数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#相机其他话题数据" class="md-toc-link">
            <p>相机其他话题数据</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#日志信息" class="md-toc-link">
            <p>日志信息</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#磁盘信息" class="md-toc-link">
            <p>磁盘信息</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#机器人操作" class="md-toc-link"><p>机器人操作</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#移动控制" class="md-toc-link">
            <p>移动控制</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#灯光控制" class="md-toc-link">
            <p>灯光控制</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#心跳指令" class="md-toc-link">
            <p>心跳指令</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#驻车使能" class="md-toc-link">
            <p>驻车使能</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#控制柜门操作" class="md-toc-link">
            <p>控制柜门操作</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#获取导航相关状态" class="md-toc-link"><p>获取导航相关状态</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#导航系统状态" class="md-toc-link">
            <p>导航系统状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#当前进行中任务状态" class="md-toc-link">
            <p>当前进行中任务状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#当前进行中任务进度" class="md-toc-link">
            <p>当前进行中任务进度</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#导航定位状态" class="md-toc-link">
            <p>导航定位状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#机器人位置" class="md-toc-link">
            <p>机器人位置</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取导航规划路径" class="md-toc-link">
            <p>获取导航规划路径</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#建图导航功能相关操作" class="md-toc-link"><p>建图导航功能相关操作</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#注意事项-2" class="md-toc-link">
            <p>注意事项</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#启动建图" class="md-toc-link">
            <p>启动建图</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#建图进度" class="md-toc-link">
            <p>建图进度</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#启动关闭导航" class="md-toc-link">
            <p>启动/关闭导航</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#初始化位置点" class="md-toc-link">
            <p>初始化位置点</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#取消当前导航任务" class="md-toc-link">
            <p>取消当前导航任务</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#暂停恢复当前导航任务" class="md-toc-link">
            <p>暂停/恢复当前导航任务</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#发送移动到下一个目标指令" class="md-toc-link">
            <p>发送移动到下一个目标指令</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置导航参数" class="md-toc-link">
            <p>设置导航参数</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置避障模式" class="md-toc-link">
            <p>设置避障模式</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#自主充电接口" class="md-toc-link"><p>自主充电接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置充电点" class="md-toc-link">
            <p>设置充电点</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取充电点" class="md-toc-link">
            <p>获取充电点</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#充电模块开关" class="md-toc-link">
            <p>充电模块开关</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置充电阈值" class="md-toc-link">
            <p>设置充电阈值</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#充电桩信息" class="md-toc-link">
            <p>充电桩信息</p>

          </a></div>
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#定时任务-设备相关接口" class="md-toc-link"><p>定时任务-设备相关接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#验证新增设备接口" class="md-toc-link">
            <p>验证新增设备接口</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#定时任务导航状态" class="md-toc-link">
            <p>定时任务导航状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#定时任务队列状态" class="md-toc-link">
            <p>定时任务队列状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#升降杆控制" class="md-toc-link">
            <p>升降杆控制</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#升降杆状态" class="md-toc-link">
            <p>升降杆状态</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#调节机械臂运动速度" class="md-toc-link">
            <p>调节机械臂运动速度</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置机械臂模式" class="md-toc-link">
            <p>设置机械臂模式</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#设置机械臂位置" class="md-toc-link">
            <p>设置机械臂位置</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#机械臂状态" class="md-toc-link">
            <p>机械臂状态</p>

          </a></div>
        </div>
      </details>
    
        </div>
      </details>
    <details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#使用案例指南" class="md-toc-link"><p>使用案例指南</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#建图流程图" class="md-toc-link">
            <p>建图流程图</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#导航流程图" class="md-toc-link">
            <p>导航流程图</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#获取机器人在地图上的位置流程图" class="md-toc-link">
            <p>获取机器人在地图上的位置流程图</p>

          </a></div><details style="padding:0;;padding-left:24px;" open="">
        <summary class="md-toc-link-wrapper">
          <a href="#postman-测试接口" class="md-toc-link"><p>postman 测试接口</p>
</a>
          </summary>
        <div>
          <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#http-请求" class="md-toc-link">
            <p>http 请求</p>

          </a></div><div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#websocket-请求" class="md-toc-link">
            <p>websocket 请求</p>

          </a></div>
        </div>
      </details>
    <div class="md-toc-link-wrapper" style="padding:0;;display:list-item;list-style:square;margin-left:42px">
          <a href="#使用流程" class="md-toc-link">
            <p>使用流程</p>

          </a></div>
        </div>
      </details>
    
        </div>
      </details>
    
</div>
</div>
      <a id="sidebar-toc-btn">≡</a>
    
    
    
    
    
    
<script>
document.body.setAttribute('html-show-sidebar-toc', true)
var sidebarTOCBtn = document.getElementById('sidebar-toc-btn')
sidebarTOCBtn.addEventListener('click', function(event) {
  event.stopPropagation()
  if (document.body.hasAttribute('html-show-sidebar-toc')) {
    document.body.removeAttribute('html-show-sidebar-toc')
  } else {
    document.body.setAttribute('html-show-sidebar-toc', true)
  }
})
</script>
      
  
    </body></html>
